Getting this error npm ERR! Failed at the build:dev script - node.js

I am running this command npm run build:dev. Getting Below error
$ npm run build:dev
# build:dev D:\project
cross-env NODE_ENV=development webpack && node react/scripts/build.dev.js
'node' is not recognized as an internal or external command,
operable program or batch file
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! build:dev: `cross-env NODE_ENV=development webpack && node react/scripts/build.dev.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the build: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\AppData\Roaming\npm-cache\_logs\2021-03-22T07_04_41_953Z-debug.log
Using node version : v10.16.0 and npm version : 6.9.0
Can anyone please help me to resolve this issue.

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.

what I can when there is error while running electron app

I made my first electron app through electronjs documentation.
I ran the application using npm start command,
but that showing me this error
$ npm start
my-electron-app#1.0.0 start C:\Users\aksha\OneDrive\Desktop\ElcDocStarter\my-electron-app
electron .
'electron' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-electron-app#1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-electron-app#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\aksha\AppData\Roaming\npm-cache\_logs\2021-02-17T08_15_08_284Z-debug.log
Install electron as global NPM module:
npm i -g electron

Always having to delete node_modules and reinstalling the packages again for npm run prod to work

I have been running to this problem,
$ npm run production
# production /var/www/html/****
cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
xnpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # production: cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # production 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! /root/.npm/_logs/2019-02-06T13_49_22_325Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # prod: npm run production
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # 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! /root/.npm/_logs/2019-02-06T13_49_22_696Z-debug.log
Each time this happens, I have to always, remove node_modules and run npm install to then again run npm run production which works after that.
Just had to update packages on the server a restart. Everything is working fine now.
apt update
restart now

Laravel Mix npm run watch fails

I'm trying to compile laravel sass files to apply the changes but every time i run (npm run watch) or (npm run dev) i get these errors...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # development 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\User\AppData\Roaming\npm-cache_logs\2019-01-01T14_42_14_962Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: npm run development -- --watch
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch 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\User\AppData\Roaming\npm-cache_logs\2019-01-01T14_42_15_042Z-debug.log
The problem is with this error is there are no node_modules.
As the Laravel Mix Documentation states:
You have to run npm install to download all the required packages for Laravel Mix.
If you have node_module folder then delete it and run npm install again.
vue-loader is a loader for webpack that allows you to author Vue components in a format.
Please run the command.
npm i vue-loader

Does not run command npm run build:prod Angular 2 project in production linux server

Execute the command npm run build:prod
I do not know if the error is in the port, or in one of the files.
npm ERR! Linux 2.6.32-642.6.2.el6.x86_64
npm ERR! argv "/root/.nvm/versions/node/v6.9.4/bin/node" "/root/.nvm/versions/node/v6.9.4/bin/npm" "run" "build:prod"
npm ERR! node v6.9.4
npm ERR! npm v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! venfi#3.3.0 build:prod: `webpack --config config/webpack.prod.js --progress --profile --bail`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the venfi#3.3.0 build:prod script 'webpack --config config/webpack.prod.js --progress --profile --bail'.
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 venfi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack --config config/webpack.prod.js --progress --profile --bail
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs venfi
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls venfi
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/clients/client6/web5/web/venfi/npm-debug.log
I have tried for many days, what can I do?
Thank you,

Resources