Laravel Mix npm run watch fails - node.js

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

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.

Failed to start npm start

I am trying to run my React project, but I am not able to run it. The project contains typescript enabled with eslint. I tried to solve the issue with the help of previously asked questions Question, but that did not work for me.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! slipstream-frontend#0.3.0 lint: `eslint --ext js,ts,tsx src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the slipstream-frontend#0.3.0 lint 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\ROHIT AGGARWAL\AppData\Roaming\npm-cache\_logs\2020-10-12T06_02_13_786Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! slipstream-frontend#0.3.0 prestart: `npm run lint`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the slipstream-frontend#0.3.0 prestart 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\ROHIT AGGARWAL\AppData\Roaming\npm-cache\_logs\2020-10-12T06_02_15_471Z-debug.log
I have tried to delete package.json file and then
npm cache clean
npm install
That didn't worked for me.
Yes this might happen,
Start with commands in terminal
npm unit react-app app_name
cd app_name
npm start

laravel npm run production Compiled successfully,but npm ERR! code ELIFECYCLE

npm run dev
was successful.
npm run prod
was unsuccessful with:
ERR! code ELIFECYCLE
npm log message after npm run prod:
DONE Compiled successfully in 91052ms 8:46:32 AM
npm 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/2020-03-13T08_46_33_901Z-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/2020-03-13T08_46_33_920Z-debug.log
To maintain team`s package version consistency,package version is fixed in package-lock.json.
What is the problem?
You could try to clear the npm cache and by deleting the node_module folder.
Remove npm Cache
$ npm cache clean --force
Delete node_modules by
$ rm -rf node_modules package-lock.json
Or delete it manually.
And then run
$ npm install

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

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