Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why I can not run Npm run dev?

Guys can you please help me on this I have trouble run npm run dev for my Laravel Mix. I followed links below but still error exist. Do i have a problem on my OS? I tried to remove node_modules, run npm install --global cross-env. and run NPM install again.

'cross-env' is not recognized as an internal or external command,

https://github.com/JeffreyWay/laravel-mix/issues/478

The error I always get when I ran npm run dev :

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`
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!     /Users/baloghdominik/.npm/_logs/2020-02-26T17_05_54_290Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ 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!     /Users/baloghdominik/.npm/_logs/2020-02-26T17_05_54_315Z-debug.log
like image 764
Dominik Balogh Avatar asked Dec 01 '22 09:12

Dominik Balogh


2 Answers

First run

npm install cross-env

npm install 

Then run

npm run dev
like image 72
VIKAS KATARIYA Avatar answered Dec 07 '22 22:12

VIKAS KATARIYA


Simple steps :

  1. npm cache clear --force
  2. delete node_modules and package-lock.json
  3. npm install
  4. npm run dev
like image 30
Md omer arafat Avatar answered Dec 07 '22 23:12

Md omer arafat