I just started using Expo, and am looking to transfer my current React Native app to it (if it all works). It relies on React Router Native for navigation and nesting ui/data. Starting from scratch (the initial starter), I ran
npm i react-router-native , imported it, and upon reloading the app I receive this error:
jest-haste-map: watch error:
Error: ENOENT: no such file or directory, open '/Users/user/projects/expo/project/node_modules/jest-haste-map/build/worker.js’
at Object.fs.openSync (fs.js:558:18)
at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:173:20)
at Object.fs.readFileSync (fs.js:468:33)
at Object.fs.readFileSync (ELECTRON_ASAR.js:506:29)
at Module._extensions…js (module.js:579:20)
at Object.require.extensions.(anonymous function) [as .js] (/Users/user/projects/expo/new-project/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
I led me to this thread: https://github.com/react-community/create-react-native-app/issues/193 where @notbrent mentioned jest-expo, along with other links https://github.com/brentvatne/jest-expo-extend-transform-ignore-patterns-example
How do I proceed from here?
this is a little bit misleading because the react-native packager (called “metro”) uses jest-haste-map internally, so this isn’t actually an issue with jest itself. are you using npm5 by chance? you mnay want to delete node_modules, delete package-lock.json, then run npm install again. if that doesn’t fix it, try using yarn. package management in js is fun!
Yes, sorry to not mention it. NPM 5.6.0, Node 7.9.0, Mac Sierra.
Ok I will run through those steps, thanks! One note, I removed my import code and any modifications to the vanilla expo starter, but it won’t restart the app (I’ve tried a few different ways). It just says “Something went wrong. Could not load exp://…” and I received these errors in the Expo console:
“Error: React native is not installed. Please run
npm install in your project directory.”
So I’ll probably start a new vanilla project from scratch, again, I guess
I also got this: Warning
Warning: You are using npm version 5.6.0. There may be bugs in this version, use it at your own risk. We recommend version 4.6.1.
I’m guessing I’ll have to downgrade as well
Thanks @notbrent! Deleting the node_modules/, package-lock.json and reinstalling worked for both issues.
Also, now I have another idea of what to do if the project won’t open again.
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.