In laravel npm run dev errors:
You need to install the cross-env
npm package.
npm install --save-dev cross-env
It's listed in your dev dependencies, make sure to run npm install
first.
In my case I had to upgrade node to version 14.
Check your node version using
node -v
And then, install a stable version from NODESOURCE
Basically,
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
After this,
npm install
Followed by the command as per your needs. In my case:
npm run dev
In case you still face issues, try NPM ERROR
Just listing other keywords of this error:
npm ERR! @ development:
mix
laravel npm ERR! code ELIFECYCLE laravel
error code ELIFECYCLE
npm ERR! Failed at the @ development script ERR! code EACCES
ERR! code ELIFECYCLE
ERR! code EMISSINGARG