Skip to content

Instantly share code, notes, and snippets.

@deepak-cotocus
Last active September 15, 2020 11:54
Show Gist options
  • Save deepak-cotocus/09a54bb9489e815595146a6715ef76cf to your computer and use it in GitHub Desktop.
Save deepak-cotocus/09a54bb9489e815595146a6715ef76cf to your computer and use it in GitHub Desktop.
stack Error: EACCES: permission denied

Error: EACCES: permission denied

Introduction:

Once you start deploying your Laravel application you may see this error in your terminal while installing npm.

npm Error:

gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/lampp/htdocs/mhn-hospitals-profile-ms/node_modules/node-sass/build'
gyp ERR! System Linux 5.3.0-1030-aws
gyp ERR! command "/usr/local/bin/node" "/opt/lampp/htdocs/mhn-hospitals-profile-ms/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /opt/lampp/htdocs/mhn-hospitals-profile-ms/node_modules/node-sass
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

image

Solution

sudo npm i --unsafe-perm

It worked for me....

OR try below commands


sudo rm -rf ~/.node-gyp
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo npm i --unsafe-perm

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment