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

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.

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

Related

Why npm can't find module '../../package.json' even if it already exists

The problem: when I start using npm commands I see the same error:
node:internal/modules/cjs/loader:933
const err = new Error(message);
^
Error: Cannot find module '../../package.json'
Require stack:
- C:\Users\Demian\AppData\Roaming\npm\node_modules\npm\lib\utils\unsupported.js
- C:\Users\Demian\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\Demian\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Demian\AppData\Roaming\npm\node_modules\npm\lib\utils\unsupported.js:2:19)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Demian\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\utils\\unsupported.js',
'C:\\Users\\Demian\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli.js',
'C:\\Users\\Demian\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'
]
}
The same problem with npm i, -v, init and etc. The same error is when I start it from C:/user or in a project with package.json where all works before. node works correctly. What should I do?

npm run build doesn't work - gulp-sourcemaps error

When I do npm install, I ran npm run build after and I got this error:
D:\Data\s20213-log210-03-lab0-ayoubmoudrika>npm run build
ets-log210-typescript-node-api#2.0.0 build
gulp build
Error: Cannot find module 'gulp-sourcemaps'
Require stack:
D:\Data\s20213-log210-03-lab0-ayoubmoudrika\gulpfile.js
D:\Data\s20213-log210-03-lab0-ayoubmoudrika\node_modules\gulp-cli\lib\shared\require-or-import.js
D:\Data\s20213-log210-03-lab0-ayoubmoudrika\node_modules\gulp-cli\lib\versioned^4.0.0\index.js
D:\Data\s20213-log210-03-lab0-ayoubmoudrika\node_modules\gulp-cli\index.js
D:\Data\s20213-log210-03-lab0-ayoubmoudrika\node_modules\gulp\bin\gulp.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object. (D:\Data\s20213-log210-03-lab0-ayoubmoudrika\gulpfile.js:4:20)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'D:\Data\s20213-log210-03-lab0-ayoubmoudrika\gulpfile.js',
'D:\Data\s20213-log210-03-lab0-ayoubmoudrika\node_modules\gulp-cli\lib\shared\require-or-import.js',
'D:\Data\s20213-log210-03-lab0-ayoubmoudrika\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js',
'D:\Data\s20213-log210-03-lab0-ayoubmoudrika\node_modules\gulp-cli\index.js',
'D:\Data\s20213-log210-03-lab0-ayoubmoudrika\node_modules\gulp\bin\gulp.js'
]
}
Here is a screenshot

Updating vue library to vue 3 using vue-next

I'm trying to upgrade a library I made to vue3, using the vue cli with vue add vue-next, but I get the following error
I removed nodemodule and installed it again, and I removed the vue-template-compiler, because it doesn't work with vue3, but it still gives me this error.
Thank you for the help in advance.
Update: I removed vue-template-compiler and now it gives me this error:
[!] Error: Cannot find module 'vue-template-compiler'
Require stack:
- C:\projects\UTT-Message-System\module\node_modules\#vue\component-compiler\dist\compiler.js
- C:\projects\UTT-Message-System\module\node_modules\#vue\component-compiler\dist\index.js
- C:\projects\UTT-Message-System\module\node_modules\rollup-plugin-vue\dist\rollup-plugin-vue.js
- C:\projects\UTT-Message-System\module\build\rollup.config.js
- C:\projects\UTT-Message-System\module\node_modules\rollup\dist\shared\loadConfigFile.js
- C:\projects\UTT-Message-System\module\node_modules\rollup\dist\bin\rollup
Error: Cannot find module 'vue-template-compiler'
Require stack:
- C:\projects\UTT-Message-System\module\node_modules\#vue\component-compiler\dist\compiler.js
- C:\projects\UTT-Message-System\module\node_modules\#vue\component-compiler\dist\index.js
- C:\projects\UTT-Message-System\module\node_modules\rollup-plugin-vue\dist\rollup-plugin-vue.js
- C:\projects\UTT-Message-System\module\build\rollup.config.js
- C:\projects\UTT-Message-System\module\node_modules\rollup\dist\shared\loadConfigFile.js
- C:\projects\UTT-Message-System\module\node_modules\rollup\dist\bin\rollup
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\projects\UTT-Message-System\module\node_modules\#vue\component-compiler\dist\compiler.js:26:26)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Object.require.extensions.<computed> [as .js] (C:\projects\UTT-Message-System\module\node_modules\rollup\dist\shared\loadConfigFile.js:516:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\projects\UTT-Message-System\module\node_modules\#vue\component-compiler\dist\index.js:6:20)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Object.require.extensions.<computed> [as .js] (C:\projects\UTT-Message-System\module\node_modules\rollup\dist\shared\loadConfigFile.js:516:13)

react-native: Error: Could not locate the bindings file. Tried:

I am getting the below error when I try to execute npm start after installing the react native dependencies. Can you please guide me on how to fix this issue.
/home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/bindings/bindings.js:135
throw err;
^
Error: Could not locate the bindings file. Tried:
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/build/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/build/Debug/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/build/Release/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/out/Debug/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/Debug/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/out/Release/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/Release/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/build/default/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/compiled/10.13.0/linux/x64/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/addon-build/release/install-root/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/addon-build/debug/install-root/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/addon-build/default/install-root/node_expat.node
→ /home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/lib/binding/node-v64-linux-x64/node_expat.node
at bindings (/home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/bindings/bindings.js:126:9)
at Object. (/home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/node-expat/lib/node-expat.js:4:32)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Object.require.extensions.(anonymous function) [as .js] (/home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/babel-register/lib/node.js:152:7)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (/home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/xml2json/lib/xml2json.js:1:13)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Object.require.extensions.(anonymous function) [as .js] (/home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/babel-register/lib/node.js:152:7)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (/home/rakesh95/Desktop/Rakesh/MyFamilyPlan/node_modules/xml2json/lib/index.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
[nodemon] app crashed - waiting for file changes before starting...
Try to first:
npm install node-gyp
if that didn't solve the issue, then you can install libxmljs again just to be sure
npm install libxmljs
Got it from "https://stackoverflow.com/questions/27541586/error-could-not-locate-the-bindings-file-tried-56"

Running bower gives me module.js:340 throw err

When I try to run bower in the cmd I get:
C:\wamp\www\budgeteer\v4\static>bower
module.js:340
throw err;
^
Error: Cannot find module 'mout'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\Imray\AppData\Roaming\npm\node_modules\bower\bin\bower:7:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
What is this error and why am I getting it? I wish the error message would explain more
You have to remove the "bower" package from your node_modules folder.
C:\wamp\www\budgeteer\v4\static> npm uninstall bower