
This is because of permission issues with global installation of packages, which npm is being denied access.
I got this error in ubuntu machine while running a command npm run prod
sh: 1: cross-env: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
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 126
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! /home/ubuntu/.npm/_logs/2020-11-05T09_35_05_202Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! @ prod: `npm run production`
npm ERR! Exit status 126
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! /home/ubuntu/.npm/_logs/2020-11-05T09_35_05_222Z-debug.log
root@ip-172-31-20-213:/opt/lampp/htdocs/mhn-admin-ms# chmod -R a+x node_modules
root@ip-172-31-20-213:/opt/lampp/htdocs/mhn-admin-ms# npm run prod
chmod -R a+x node_modules
sudo chown -R $USER /usr/local
And cd /path/of/project
chmod -R a+x node_modules
npm run watch
npm rebuild
npm run watch
rm -Rf node_modules
npm install
npm run watch
MotoShare.in is your go-to platform for adventure and exploration. Rent premium bikes for epic journeys or simple scooters for your daily errands—all with the MotoShare.in advantage of affordability and ease.