npm doesn't start propperly, Cannot find module 'worker_threads - node.js

I've got following version in node: v10.24.0 and following version in npm: 6.14.11.
Now when I want to start my Angular frontend with the command ng serve there will be thrown following error code:
ng serve
An unhandled exception occurred: Cannot find module 'worker_threads'
See "/tmp/ng-10r9yq/angular-errors.log" for further details.
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! frontend#0.0.0 start: ng serve
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the frontend#0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/.npm/_logs/2021-08-10T09_38_36_059Z-debug.log

You can try updating your Node Version to 14.0.0 or higher and it should work as desired

Related

not able to start frontend app of jhipster project

I created a jhipster project. But I am not able to run the application using mvnw command. after starting the app using mvnw the browser displays the error message that says the front end app is not running, try starting it separately. there's no error in the log.
However, when I tried starting the front end application alone with the "npm start" command I got the following error,
> light-sail#0.0.1-SNAPSHOT webpack C:\personal\code\POC\LightSail
> node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "serve" "--config" "webpack/webpack.dev.js" "--inline" "--env" "stats=minimal"
[webpack-cli] Unable to load '#webpack-cli/serve' command
[webpack-cli] TypeError: options.forEach is not a function
at WebpackCLI.makeCommand (C:\personal\code\POC\LightSail\node_modules\webpack-cli\lib\webpack-cli.js:173:21)
at ServeCommand.apply (C:\personal\code\POC\LightSail\node_modules\#webpack-cli\serve\lib\index.js:41:19)
at loadCommandByName (C:\personal\code\POC\LightSail\node_modules\webpack-cli\lib\webpack-cli.js:907:35)
at async Command.<anonymous> (C:\personal\code\POC\LightSail\node_modules\webpack-cli\lib\webpack-cli.js:1462:17)
at async Promise.all (index 0)
at async WebpackCLI.run (C:\personal\code\POC\LightSail\node_modules\webpack-cli\lib\webpack-cli.js:1500:9)
at async runCLI (C:\personal\code\POC\LightSail\node_modules\webpack-cli\lib\bootstrap.js:11:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! light-sail#0.0.1-SNAPSHOT webpack: `node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "serve" "--config" "webpack/webpack.dev.js" "--inline" "--env" "stats=minimal"`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the light-sail#0.0.1-SNAPSHOT webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2021-11-14T10_08_32_848Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! light-sail#0.0.1-SNAPSHOT webpack-dev-server: `npm run webpack -- serve "--config" "webpack/webpack.dev.js" "--inline" "--env" "stats=minimal"`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the light-sail#0.0.1-SNAPSHOT webpack-dev-server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2021-11-14T10_08_32_877Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! light-sail#0.0.1-SNAPSHOT webapp:dev: `npm run webpack-dev-server -- --config webpack/webpack.dev.js --inline --env stats=minimal`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the light-sail#0.0.1-SNAPSHOT webapp:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2021-11-14T10_08_32_918Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! light-sail#0.0.1-SNAPSHOT start: `npm run webapp:dev`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the light-sail#0.0.1-SNAPSHOT start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2021-11-14T10_08_32_967Z-debug.log
the package.json has the following version,
"webpack-cli": "4.7.2",
UPDATE
installed node version is v14.17.5
can anyone help?
the jhipster version I was using was 7.1.0. After upgrading it to 7.3.1 everything works fine.

with NODE js, I type in Terminal npm, and it starts showing me the error. And I can't solve it

When I write on Visual Studio Code and I want to verify the result with Node.js I write on the Terminal npm start it shows me. And I can't solve it. Note that the version for Node 6.14.8. And laptop device:MacBook Air
MacBook-Air-alkhas-b-rjayy:new app 19:2 rjayy$ cd my-app
MacBook-Air-alkhas-b-rjayy:my-app rjayy$ npm start
> my-app#0.1.0 start /Users/rjayy/Desktop/react/my-app/src/new app 19:2/my-app
> react-scripts start
sh: react-scripts: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! my-app#0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the my-app#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/rjayy/.npm/_logs/2021-03-09T17_37_55_559Z-debug.log
MacBook-Air-alkhas-b-rjayy:my-app rjayy$
you need to install the necessary libraries.
cd my-app MacBook-Air-alkhas-b-rjayy:my-app
and then
npm install
and then
npm start

ERROR in Entry module not found using webpack with react.js

Someone who can help me how to solve this error when configuring the webpack.
I am using React.js
The error is as follows:
ERROR in Entry module not found: Error: Can't resolve 'C:\react\index.js' in 'C:\react'
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! platzivideo#1.0.0 build:prod: webpack -p --env.NODE_ENV=production
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the platzivideo#1.0.0 build:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\AppData\Roaming\npm-cache_logs\2018-07-22T21_33_42_548Z-debug.log

ERR! while running node.js app

Whenever I try to run node.js application, I get error messages though application runs successfully. Just curious what does these errors really mean.
Here is the output from the console while running a simple node.js application:
npm ERR! node v6.11.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! app-service-hello-world#0.0.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the app-service-hello-world#0.0.1 start script 'node index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the app-service-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs app-service-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls app-service-hello-world
npm ERR! There is likely additional logging output above.

npm start command gives error : http-server:command not found , code: ELIFECYCLE

I am new be to node js . started to set up node js project .
Got error when npm start command is used.
npm start
> sigma#1.1.0 start /usr/local/UserProfile/TitanUI
> http-server -p 8080
sh: http-server: command not found
npm ERR! Linux 2.6.32-504.8.1.el6.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.7.0
npm ERR! npm v3.10.3
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! sigma#1.1.0 start: `http-server -p 8080`
npm ERR! spawn ENOENT
npm ERR! Failed at the sigma#1.1.0 start script 'http-server -p 8080'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sigma package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! http-server -p 8080
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sigma
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sigma
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/local/UserProfile/TitanUI/npm-debug.log
These are the versions of centos , npm and node js.
centos:6.6
npm:3.10
nodejs:6.7.0
I guess I have latest versions only..Please help me if any one knows about this.
Removed the node modules folder and ran "npm install" and "npm start" again. This solved the above error. Thanks!

Resources