I'm getting this error Invalid Directory /Users/node_modules/superagent
with a React Native project. I'm not sure why it would be looking for the module in this location? How can I fix this to search for the module inside the node_modules
directory of the React Native project where it is actually located?
The problem is npm3. You have to downgrade it to npm2 because the flattened packages don't seem to work yet with react-native.
I may be running into a similar issue over at Using PubNub with React Native
I used nvm to downgrade to Node v4.2.2 and then npm dropped itself automatically to 2.14.7. Re-created the React Native project (using react-native init
) so that there was no longer a flat modules directory. However, still getting the same error when requiring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With