gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/we                                                                             b3/node_modules/sha3/.node-gyp'
gyp ERR! System Linux 4.15.0-70-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gy                                                                             p/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/web3/node_modules/sha3
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional log                                                                             ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/yuching/.npm/_logs/2019-11-27T17_08_23_043Z-debug.log
  • 1
    Well... have you checked to see what's inside file /home/yuching/.npm/_logs/2019-11-27T17_08_23_043Z-debug.log? It might actually tell you a lot. Nov 27, 2019 at 17:40
  • 1
    Hi! I see a "permission denied", have you tried with sudo? Nov 28, 2019 at 12:16

1 Answer 1


I would first try

  • sudo chmod 777 ~/.node_modules
  • If this doesnt work, try it with installing it with the unsafe perm option

sudo npm install -g --unsafe-perm

  • If this doesnt work try to rebuild node gyp

sudo node-gyp rebuild -g --unsafe-perm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.