7

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
miken32
  • 42,008
  • 16
  • 111
  • 154
Dominik Balogh
  • 305
  • 1
  • 3
  • 12

5 Answers5

17

First run

npm install cross-env

npm install 

Then run

npm run dev
VIKAS KATARIYA
  • 5,867
  • 3
  • 17
  • 34
6

Simple steps :

  1. npm cache clear --force
  2. delete node_modules and package-lock.json
  3. npm install
  4. npm run dev
Ryan M
  • 18,333
  • 31
  • 67
  • 74
Md omer arafat
  • 398
  • 7
  • 10
5
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install

Basically delete the node_modules folder and package-lock.json file , clear cache and do an npm install. Worked for me.

dbc
  • 104,963
  • 20
  • 228
  • 340
Alfred Okumbe
  • 61
  • 1
  • 2
0

In my case I had old version of node.js so I just installed version I need:

sudo npm install n -g

sudo n stable

Or can try use latest:

sudo n latest

0

If u using nvm, u need use version for project. Commands helped for me:

  1. Use default version node: nvm use system
  2. Remove node_modules rm -rf node_modules and rm -f package-lock.json
  3. Clear cache npm cache clear --force
  4. Finished command npm i
Vito Bryliano
  • 161
  • 1
  • 5