sh: 1: cross-env: Permission denied on laravel mix

As @savedbeau suggests, running the following fixes this problem:


npm rebuild

followed by

npm run watch

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.


The following thing worked for me

chmod -R a+x node_modules

source


I was on ubuntu 18.

Following command helped me :-)

npm rebuild

Documented as follows, on the official website.

This command runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary. It is also useful when installing with --ignore-scripts and --no-bin-links, to explicitly choose which packages to build and/or link bins.

If one or more package names (and optionally version ranges) are provided, then only packages with a name and version matching one of the specifiers will be rebuilt.