Reputation: 11
I update the Node latest version to 15.0.1 & npm 7.0.3. After i installed node modules and run my project with npm start its showing these type of errors....
cross-env NODE_ENV=development webpack-dev-server --open --config webpack.dev.js
node:events:304 throw er; // Unhandled 'error' event ^
Error: spawn webpack-dev-server ENOENT at Process.ChildProcess._handle.onexit (node:internal/child_process:269:19) at onErrorNT (node:internal/child_process:465:16) at processTicksAndRejections (node:internal/process/task_queues:80:21) Emitted 'error' event on ChildProcess instance at: at Process.ChildProcess._handle.onexit (node:internal/child_process:275:12) at onErrorNT (node:internal/child_process:465:16) at processTicksAndRejections (node:internal/process/task_queues:80:21) { errno: -2, code: 'ENOENT', syscall: 'spawn webpack-dev-server', path: 'webpack-dev-server', spawnargs: [ '--open', '--config', 'webpack.dev.js' ] } npm ERR! code 1 npm ERR! command failed npm ERR! command sh -c cross-env NODE_ENV=development webpack-dev-server --open --config webpack.dev.js
npm ERR! A complete log of this run can be found in: npm ERR! /home/krishnasai/.npm/_logs/2020-10-28T09_44_19_855Z-debug.log
Upvotes: 1
Views: 2889
Reputation: 10142
feels to me that you installed cross-env
globally, and it might break whenever you switch node versions.
i would advise you to have cross-env
in the dependency of your project. you can do that by installing cross-env
and specify that you would like to save it in your package.json
.
try this
npm install --save-dev cross-env
then try again to run your project.
Upvotes: 1