Home » Errors & Failures » Solved : EACCES current user (“nobody”) does not have permission to access the dev dir

Solved : EACCES current user (“nobody”) does not have permission to access the dev dir

When we tried to install “sitespeed.io” on Ubuntu 18.04, as mentioned in installation steps “npm install -g sitespeed.io” we got following errors,

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/home/devlab/.cache/node-gyp/8.10.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/sitespeed.io/node_modules/sse4_crc32/.node-gyp"
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/local/lib/node_modules/sitespeed.io/node_modules/sse4_crc32/.node-gyp'
gyp ERR! System Linux 5.3.0-61-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/sitespeed.io/node_modules/sse4_crc32
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
Unable to save binary /usr/local/lib/node_modules/sitespeed.io/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/sitespeed.io/node_modules/node-sass/vendor'
    at Object.fs.mkdirSync (fs.js:885:18)
    at sync (/usr/local/lib/node_modules/sitespeed.io/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/local/lib/node_modules/sitespeed.io/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/usr/local/lib/node_modules/sitespeed.io/node_modules/node-sass/scripts/install.js:114:11)
    at Object. (/usr/local/lib/node_modules/sitespeed.io/node_modules/node-sass/scripts/install.js:157:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/usr/local/lib/node_modules/sitespeed.io/node_modules/node-sass/vendor' }
gyp verb remove removing development files for version: 8.10.0
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/sitespeed.io/node_modules/node-sass/.node-gyp'
gyp ERR! System Linux 5.3.0-61-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/sitespeed.io/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/local/lib/node_modules/sitespeed.io/node_modules/node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

Solution which worked for us,

The one solution is to properly identify what are the permission issues, although we had run npm command with sudo permission or create those directories manually using mkdir and run again, or we tried following command by adding “–unsafe” and it worked,

$ sudo npm install -g sitespeed.io --unsafe 
Enable GCP Linux Root Account and S...
Enable GCP Linux Root Account and SSH Log in Using Username and Password

Leave a Comment

Sign up to our newsletter!