I receive an error when running npm as below:
npm run dev
.
.
.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # dev: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=./webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # dev script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=./webpack.config.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 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=./webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
I tried different ways and the internet to make the script running but it keeps generating the same error.
I attached the log file.
Please advice,
Related
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
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
I use laravel 5.4
I follow here : https://laravel.com/docs/5.4/mix
If I run this : npm install --no-bin-links, the result like this :
npm WARN deprecated express#2.5.11: express 2.x series is deprecated
npm WARN deprecated connect#1.9.2: connect 1.x series is deprecated
npm ERR! Windows_NT 6.2.9200 npm ERR! argv "C:\Program
Files\nodejs\node.exe"
"C:\Users\chelsea\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js"
"install" "--no-bin-links" npm ERR! node v6.9.1 npm ERR! npm v3.10.9
npm ERR! Maximum call stack size exceeded npm ERR! npm ERR! If you
need help, you may report this error at: npm ERR!
https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\myshop\npm-debug.log
There exist error
How can I solve the error?
I use windows 7
I want to fix the error, because I want to compile assets (npm run watch)
Update :
After that I try run npm run dev, the result like this :
# dev C:\xampp\htdocs\myshop
npm run development
# development C:\xampp\htdocs\myshop
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
'cross-env' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 6.2.9200 npm ERR! argv "C:\Program
Files\nodejs\node.exe"
"C:\Users\chelsea\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js"
"run" "development" npm ERR! node v6.9.1 npm ERR! npm v3.10.9 npm
ERR! code ELIFECYCLE 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 npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the # development script
'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js
--progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.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 package,
npm ERR! not with npm itself. npm ERR! Tell the author that this fails
on your system: npm ERR! cross-env NODE_ENV=development
node_modules/webpack/bin/webpack.js --progress --hide-modules
--config=node_modules/laravel-mix/setup/webpack.config.js npm ERR! You can get information on how to open an issue for this project with: npm
ERR! npm bugs npm ERR! Or if that isn't available, you can get
their info via: npm ERR! npm owner ls npm ERR! There is likely
additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\myshop\npm-debug.log
npm ERR! Windows_NT 6.2.9200 npm ERR! argv "C:\Program
Files\nodejs\node.exe"
"C:\Users\chelsea\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js"
"run" "dev" npm ERR! node v6.9.1 npm ERR! npm v3.10.9 npm ERR! code
ELIFECYCLE npm ERR! # dev: npm run development npm ERR! Exit status
1 npm ERR! npm ERR! Failed at the # dev script 'npm run development'.
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
package, npm ERR! not with npm itself. npm ERR! Tell the author that
this fails on your system: npm ERR! npm run development npm ERR!
You can get information on how to open an issue for this project with:
npm ERR! npm bugs npm ERR! Or if that isn't available, you can get
their info via: npm ERR! npm owner ls npm ERR! There is likely
additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\myshop\npm-debug.log
I try fix it with answer from #Yevgeniy Afanasyev
This : Laravel 5.4 'cross-env' is not recognized as an internal or external command
But it's the same
Try to execute this command one more time.
I'm with Centos7, installed on VirtualBox (true OS: Windows 7).
Node version: 6.10.3
Npm version: 3.10.10
I installed vue-cli, like this:
sudo npm install -g vue-cli
Then I created a new vue project, like this:
sudo vue init webpack-simple mynewproject
But I get an error when running "npm run dev":
> mynewproject#1.0.0 dev /var/www/html/mynewproject
> cross-env NODE_ENV=development webpack-dev-server --open --hot
sh: cross-env : commande introuvable
npm ERR! Linux 3.10.0-514.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! vuetest#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the mynewproject#1.0.0 dev script 'cross-env NODE_ENV=development webpack-dev-server --open --hot'.
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 vuetest package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development webpack-dev-server --open --hot
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs vuetest
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls vuetest
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/mynewproject/npm-debug.log
Does anyone know how to fix it?
You need to cd to your project directory and run:
npm install
You can find the instructions on the webpack-simple github repo
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,