I\'m trying to run npm run dev
but the following error occur:
sh: 1: cross-env: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ER
Try this.
$ rm -rf node_modules
$ npm cache clear --force
$ npm install npm@latest -g
$ chown -R $USER ~/.npm
$ npm install
I remove the Nodejs and install the latest version of Nodejs
This is because of permission issues with global installation of packages, which npm is being denied access.
To solve this try
1.
npm rebuild
npm run watch
Or 2
rm -Rf node_modules
npm install
npm run watch
Hope it works.
I was on ubuntu 18.
Following command helped me :-)
npm rebuild
Ok I figure out the problem, the storage where the project is saved is auto-mounted and it have no execution permission.
easily in /etc/fstab file i added exec
in the mount option, like this:
auto,user,exec,utf8,uid=1000,gid=1000,rw 0 0