I am trying to run a test with react/jest. When I do npm test /jest, I am getting the following error:
> # test /Users/suparnasoman/Downloads/create-react-app-master
> node packages/react-scripts/scripts/test.js --env=jsdom
module.js:471
throw err;
^
Error: Cannot find module 'jest'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/suparnasoman/Downloads/create-react-app-master/packages/react-scripts/scripts/test.js:26:14)
at Module._compile (module.js:570:32)
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)
npm ERR! Test failed. See above for more details.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
Check if the npm package is installed successfully.
If the installation is successful check if it is installed globally/locally.
If local, you might need to provide the absolute path node_modules/bin/jest
It seems the jest module is missing, did you try npm --save install jest, or npm install as Chase mentioned?
Related
I have created a fresh app with CRA and want to add Sass support according to its official description which simply says to add it with yarn add node-sass
but this throws an error
error /home/.../frontend/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments:
Directory: /home/.../frontend/node_modules/node-sass
Output:
module.js:550
throw err;
^
Error: Cannot find module 'delegates'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/amir/WORKSPACE/daypay/daypay_v2/frontend/node_modules/are-we-there-yet/tracker-stream.js:4:16)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
I dont know why but it seems node_modules where messed up though it was a new created app.
SO I hard coded the node-sass and #types/node-sass in package.json deleted the yarn.lock or (package-lock) and node_modules folder and run yarn install again
Hello I have a problem with my webservice. After update all files from master fornt- doesn't work (I use react js, webpack, node js). When i try to start project
I have something like this :
Error: Cannot find module 'webpack'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Projekt\crew\crew-ui\webpack.config.js:1:77)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
So I try install webpack from console but I have next error:
"C:\Program Files\JetBrains\IntelliJ IDEA 2018.1\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" install --scripts-prepend-node-path=auto
npm WARN deprecated nomnom#1.8.1: Package no longer supported. Contact support#npmjs.com for more info.
npm ERR! code E404
npm ERR! 404 Not Found: React#latest
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mtmi\AppData\Roaming\npm-cache\_logs\2018-06-28T07_27_01_002Z-debug.log
When trying npm start or ng serve it shows the error like this :
The "#angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '#angular/compiler-cli'
Error: The "#angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '#angular/compiler-cli'
at Object. (/home/jsnsree/.nvm/versions/node/v6.11.2/lib/node_modules/#angular/cli/node_modules//src/index.js:14:11)
at Module._compile (module.js:570:32)
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. (/home/jsnsree/.nvm/versions/node/v6.11.2/lib/node_modules/#angular/cli/tasks/eject.js:10:19)
at Module._compile (module.js:570:32)
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)
And the ng versoin in my application shows :
#angular/cli: 1.3.2
node: 6.11.2
os: linux x64
#angular/animations: error
#angular/common: error
#angular/compiler: error
#angular/core: error
#angular/forms: error
#angular/http: error
#angular/platform-browser: error
#angular/platform-browser-dynamic: error
#angular/platform-server: error
#angular/router: error
#angular/cli: error
#angular/compiler-cli: error
I tried to remove and reinstall angular/cli but it doesn't make any changes:
Try re-installing your CLI.
npm uninstall -g #angular/cli
npm cache clean
npm install -g #angular/cli#latest
delete node_modules from your project
and run
npm install
this will work
Try this command:
npm install #angular/{animations,common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router}
Getting Following error message,I tried to fix by updating npm and reinstall of mean stack application by running npm install
Error: Cannot find module 'npm'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous>
(C:\Users\Laptop2\AppData\Roaming\npm\node_modules\mean-cli\lib\cli.js:5:7)
at Module._compile (module.js:570:32)
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)
Update Npm by using following command issue resolve
npm install npm#latest -g
Try:
npm install npm#latest -g
I installed npm, bower and gulp. But while running gulp app:serve, I am getting the following error.
Please help me.
This is the command I run:
sachin#sachin:~/Desktop/workspace/myproj/angular/ex (master)$gulp app:serve
Result I got:
Error: Cannot find module 'require-dir'
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> (/home/sachin/Desktop/workspace/myproj/angular/ex/gulpfile.js:14:1)
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 Module.require (module.js:364:17)
Error: Cannot find module 'require-dir'
You've installed gulp but have not installed its tasks' dependencies. E.g. if a gulp task has any require('') calls, then it depends on require-dir. Those dependencies are probably in your project's package.json file. To install all the dependencies run:
npm install