🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

ERROR: sh: 1: cross-env: Permission denied

Ubuntu-Machine

Error:

sh: 1: cross-env: Permission denied Ubuntu

Introduction:

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

Error:

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

image

Solution

Worked for me

chmod -R a+x node_modules

First

sudo chown -R $USER /usr/local

And cd /path/of/project

chmod -R a+x node_modules

npm run watch

If not work

npm rebuild

npm run watch

If not work

rm -Rf node_modules

npm install

npm run watch

It worked for me....

Then run npm run prod and check evrything will work fine.

Thanks

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.