tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
615 stars 112 forks source link

Error on new RN 0.45.1 #41

Closed taipa-ibl closed 7 years ago

taipa-ibl commented 7 years ago

After run ./node_modules/.bin/rn-nodeify --hack --install

.....
......
installing from npm readable-stream
installing: npm install --save tradle/react-native-http#834492d readable-stream@1.0.33
npm WARN gentlyRm not removing /Users/anhtai/Develop/RNApp01/node_modules/.bin/jest as it wasn't installed by /Users/anhtai/Develop/RNApp01/node_modules/jest-cli
npm WARN react-native-level-fs@3.0.0 requires a peer of asyncstorage-down@^3.0.0 but none was installed.

+ readable-stream@1.0.33
+ react-native-http@1.0.0
added 2 packages, removed 686 packages and updated 61 packages in 38.5s
/Users/anhtai/Develop/RNApp01/node_modules/rn-nodeify/cmd.js:66
      if (err) throw err
               ^

Error: ENOENT: no such file or directory, open '/Users/anhtai/Develop/RNApp01/node_modules/rn-nodeify/shim.js'

And because of it remove almost module, so react-native project can't run anymore.

mvayngrib commented 7 years ago

@TaiPA I haven't tried rn-nodeify with RN > 0.42.3 yet. If I understood correctly, I'm sorry to hear it broke your project! Other than package.json, it should only touch files in node_modules, so you should always be able to rm -rf node_modules and npm install again.

Maybe you can try to figure out what goes wrong and submit a PR? :)

brentmitchell25 commented 7 years ago

I ran into this same issue. It appeared to delete itself in the process. I re-ran the process after a simple rm -rf node_modules/ and it worked. May also be worthing noting that I am using npm 3.

xwartz commented 7 years ago

I have the same issue,but it worked when i use node 6.9.2 and npm 3.10.9.

mvayngrib commented 7 years ago

yea, tldr use npm@3, npm@5 has some issues. See https://github.com/infinitered/ignite/issues/1101 https://github.com/npm/npm/issues/16839

TSB1999 commented 2 years ago

rm -rf node_modules

worked for me after rm -rf node_modules, then yarn install