# Ingest data with Node.js on Elastic Search service

**URL:** <https://discuss.elastic.co/t/ingest-data-with-node-js-on-elastic-search-service/333082>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [May 10, 2023, 11:54am UTC](https://discuss.elastic.co/t/ingest-data-with-node-js-on-elastic-search-service/333082 "2023-05-10T11:54:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie\_coder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/newbie_coder/32/120872_2.png) [@newbie\_coder](https://discuss.elastic.co/u/newbie_coder)\
**Post date:** [May 10, 2023, 11:54am UTC](https://discuss.elastic.co/t/ingest-data-with-node-js-on-elastic-search-service/333082/1 "2023-05-10T11:54:49Z")

</div>

I have a simple app and I want to ingest data from my app to Elastic Search sevice. I followed the steps from [this](https://www.elastic.co/guide/en/cloud/current/ec-getting-started-node-js.html#ec-getting-started-node-js) tutorial which seem pretty straightforward - get a free trial, create a deployment, then install with `npm install @elastic/elasticsearch` and then test your connection.

After running `npm install @elastic/elasticsearch` I can not start my app. I am running it from the terminal with Expo. I keep getting errors from the type: `The package at "node_modules/@elastic/transport/lib/connection/HttpConnection.js" attempted to import the Node standard library module "http". It failed because the native React runtime does not include the Node standard library.` I keep installing these packages with `npm install os`, but the errors keep persisting with ifferent packages. So I installed packages `os`, `events`, `paths` and so on. The latest such error is with the package `http`. I ran `npm install http` but the error keep persisting.

I can not start my react native project, and my free trial expires soon. Can someone please advise because I lost several days on this error?

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [May 11, 2023, 2:58pm UTC](https://discuss.elastic.co/t/ingest-data-with-node-js-on-elastic-search-service/333082/2 "2023-05-11T14:58:03Z")

</div>

Can Node.js be used with the React Native runtime? I've not got much experience with React Native, but I did find several threads saying they can't be used together, including the below:

> <https://github.com/facebook/react-native/issues/28360>
>
> \## Description:
> When I try to run my react-native app on ios or android Metro B…undler raises an error saying that I dont have http module installed.
> 
> I have tryed this but does not work:
> \`watchman watch-del-all\`
> \`rm -rf node\_modules\`
> \`run yarn install\`
> \`yarn start --reset-cache\`
> \`rm -rf /tmp/metro-\*\`
> 
> I have also reinstalled react-native again, downgraded the version, reinstalled express module and create another new project but the error still exists.
> 
> 
> \### React Native version:
> 
> Node: 13.11.0 - /usr/local/bin/node
> Yarn: 1.22.4 - /usr/local/bin/yarn
> npm: 6.13.7 - /usr/local/bin/npm
> Watchman: 4.9.0 - /usr/local/bin/watchman
> react: 16.13.1 =\> 16.13.1 
> react-native: 0.61.5 =\> 0.61.5
> 
> 
> 
> \## Steps To Reproduce
> 
> 1. Try to upload a new app into any simulator.
> 
> \## Expected Results
> 
> I was expecting the app to work normally as it did one month ago.
> 
> \## Snack, code example, screenshot, or link to a repository:
> 
> error: bundling failed: Error: Unable to resolve module \`http\` from \`node\_modules/express/lib/application.js\`: http could not be found within the project.
> 
> If you are sure the module exists, try these steps:
> 1. Clear watchman watches: watchman watch-del-all
> 2. Delete node\_modules: rm -rf node\_modules and run yarn install
> 3. Reset Metro's cache: yarn start --reset-cache
> 4. Remove the cache: rm -rf /tmp/metro-\*
> at ModuleResolver.resolveDependency (node\_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:186:15)
> at ResolutionRequest.resolveDependency (node\_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
> at DependencyGraph.resolveDependency (node\_modules/metro/src/node-haste/DependencyGraph.js:282:16)
> at Object.resolve (node\_modules/metro/src/lib/transformHelpers.js:267:42)
> at node\_modules/metro/src/DeltaBundler/traverseDependencies.js:426:31
> at Array.map (\<anonymous\>)
> at resolveDependencies (node\_modules/metro/src/DeltaBundler/traverseDependencies.js:423:18)
> at node\_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33
> at Generator.next (\<anonymous\>)
> at asyncGeneratorStep (node\_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)
> \`\`\`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 8, 2023, 2:58pm UTC](https://discuss.elastic.co/t/ingest-data-with-node-js-on-elastic-search-service/333082/3 "2023-06-08T14:58:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
