4

Actually I am trying to install express-basic-auth, but it fails due to the installation of scrypt@6.0.3. I already tried:

sudo apt-get install build-essential

and also tried deleting ~/.node-gyp as stated here: https://github.com/nodejs/node-gyp/issues/809, but none of the suggestions helped. I still get the same error:

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/user/code/a/b/node_modules/scrypt/build'
gyp ERR! System Linux 4.20.0-042000-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/code/a/b/node_modules/scrypt
gyp ERR! node -v v9.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN b@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 install 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/user/.npm/_logs/2018-12-30T20_52_24_060Z-debug.log

Can anybody help?

sunwarr10r
  • 4,420
  • 8
  • 54
  • 109

1 Answers1

2

I solved this problem by installing an earlier version of node locally, in my case the node 8.10.0 version. I stopped getting the same error you are getting here. Delete your node modules and package-lock.json then run

npm install --save node@earlierversion
npm install rest of packages

That's what I did to rebuild my node modules and prevent this error.

  • This worked for me. Had various command line build tools installed after the node-gyp catalina.md readme, but nothing helped. scrypt@6.0.3 build failed with latest node-gyp and latest node@v12 LTS I could make it work using node version 8.10.0 strangely without changing anything else. – AirUp Jan 15 '20 at 10:36