Ever since upgrading to Node 8.0.0 and npm 5.0.1, I’m having a lot of projects getting the Expo XDE to compile my apps. I’m running on Mac OSX 10.12.5. I get errors like:
Error: React native is not installed. Please run npm install in your project directory.
Problem checking node_modules dependencies: Unexpected end of JSON input
Even though I just ran npm install many times. I also ran npm cache clean --force, I reinstalled both node and npm. Still it doesn’t work.
Hi I installed via yarn install but I still get this error in XDE: "Problem checking node_modules dependencies: Unexpected end of JSON input". Altho everything seems to still work and I don’t have the “React native is not installed” error.
@notbrent do you happen to know why it behaves this way?
Hi, I run npm 5.0.3 to install react-apollo, then I get a package-lock.json, is this wrong? Do I need to do something to fix it?
After see your answer, I have downgraded npm to 4.6.1, can I go ahead to install reac-navigation or other packages now? Yesterday I use npm 5.0.3 to install react-navigation and also received the error message: React native is not installed.
basically you should not use npm5 on any projects right now. you can remove it and delete node_modules and package-lock and continue development as usual
I tried using yarn, I tried using npm 4.6.1, i try deleting and reinstalling expo, i tried going back to a version that 100% worked, i tried restarting my computer, i tried deleting my node_modules folder / package-lock.json / yarn.lock files, I tried all those things expo tells you to do like “run watchman watch-del-all” and the other ones,I tried doing all of these things in different orders. But I still get errors like these:
unable to resolve module: node_modules/react-native/Libraries/Performance/Systrace.js module does not exist in the module map or in these directories ....
It always seems to have issue with loading the node_modules.
This is super frustrating. I sit down to code, and I end up troubleshooting expo for hours (when I haven’t made any change). What exactly am I doing to cause this to happen? What is the correct process for debugging this? I follow all of the recommendations in the error messages, but nothing works.
I had the same issue but with a different error. None of the mentioned recommendations worked for me as well. Then I tried to create a new project using console, not XDE:
create-react-native-app your-app-name
cd your-app-name/
npm start
npm run ios / npm run android
Fortunately, that worked for me. Hope that may help you too.