Carly Fristoe
Carly Fristoe

Reputation: 45

jest-haste-map: watch error complaining that it can't find a file in the jest-haste-map node_modules folder

I just upgraded to RN 0.56.0 and am using jest version: 22.4.3 (updating the jest version doesn't help) When I try to run my test suite, I get the following error in the terminal:

jest-haste-map: watch error: Error: ENOENT: no such file or directory, 
open '/Users/mobilepractice/builds/0bcf5ed0/0/cx-mobile/posting- 
plus/PostingPlus/node_modules/jest-haste-map/build/worker.js' at Error 
(native) at Object.fs.openSync (fs.js:640:18) at Object.fs.readFileSync 
(fs.js:508:33) at Module._extensions..js (module.js:578:20) at 
Object.require.extensions.(anonymous function) [as .js] 
(/Users/mobilepractice/builds/0bcf5ed0/0/cx-mobile/posting- 
plus/PostingPlus/node_modules/babel-register/lib/node.js:152:7) at 
Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at 
Function.Module._load (module.js:438:3) at Module.require 
(module.js:497:17) at require (internal/module.js:20:19)

and this error as well:

/Users/mobilepractice/builds/0bcf5ed0/0/cx-mobile/posting- 
plus/PostingPlus/node_modules/react-native/jest/hasteImpl.js:50 ) /*: 
string | void */ { ^ SyntaxError: Unexpected token ) at 
Object.exports.runInThisContext (vm.js:76:16) at Module._compile 
(module.js:542:28) at Object.Module._extensions..js (module.js:579:10) 
at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at 
Function.Module._load (module.js:438:3) at Module.require 
(module.js:497:17) at require (internal/module.js:20:19) at Object. 
<anonymous> (/Users/mobilepractice/builds/0bcf5ed0/0/cx-mobile/posting- 
plus/PostingPlus/node_modules/jest-runtime/node_modules/jest-haste- 
map/build/worker.js:16:19) at next (native)

I can see the worker.js file in my node_modules folder, which is why the ENOENT error is confusing.

Upvotes: 1

Views: 1246

Answers (1)

Carly Fristoe
Carly Fristoe

Reputation: 45

A solution is to make sure node 8 or higher is installed. This error occurs on node 6.9.1.

Upvotes: 1

Related Questions