Node standard library module "url". It failed because React Native does not include the Node standard library.

#1
The package at "node_modules/particle-api-js/lib/EventStream.js" 
attempted to import the Node standard library module "url". 
It failed because React Native does not include the Node standard library. 
Read more at https://docs.expo.io/versions/latest/introduction/faq/#can-i-use-nodejs-packages-with-expo

Maybe I’m reading this wrong but in the link to the expo docs it says

As a side note, some Node standard library APIs do not depend on C++ extensions but instead can be implemented directly in JavaScript, such as url and assert. If a package you wish to use only depends on these Node APIs, you can install them from npm and the package will work.

It is complaining about ‘url’ but the docs say that it should work.

I also tried to nmp install url

  "dependencies": {
    "expo": "^32.0.0",
    "particle-api-js": "^7.4.0",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
    "url": "^0.11.0"
  },

But that didn’t do the trick

1 Like