Blitz: EACCES: permission denied even with sudo npm install

Created on 3 Sep 2020  路  5Comments  路  Source: blitz-js/blitz

What is the problem?

i am failing to install blitz even with sudo enabled.

sudo npm install -g blitz
Password:
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
/usr/local/bin/blitz -> /usr/local/lib/node_modules/blitz/bin/blitz

> [email protected] install /usr/local/lib/node_modules/blitz/node_modules/next/node_modules/fsevents
> node install.js

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/wanshawn/Library/Caches/node-gyp/12.18.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/blitz/node_modules/next/node_modules/fsevents/.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/blitz/node_modules/next/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/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/blitz/node_modules/next/node_modules/fsevents
gyp ERR! node -v v12.18.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

> [email protected] install /usr/local/lib/node_modules/blitz/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/wanshawn/Library/Caches/node-gyp/12.18.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/blitz/node_modules/watchpack-chokidar2/node_modules/fsevents/.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/blitz/node_modules/watchpack-chokidar2/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/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/blitz/node_modules/watchpack-chokidar2/node_modules/fsevents
gyp ERR! node -v v12.18.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

> [email protected] postinstall /usr/local/lib/node_modules/blitz/node_modules/ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)


> @ampproject/[email protected] postinstall /usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer
> node lib/warmup.js



AMP Optimizer ERROR Could not write cache file Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/.cache'
    at mkdirSync (fs.js:914:3)
    at FileSystemCache.set (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-core/lib/FileSystemCache.js:61:9)
    at fetchLatestRuntimeData_ (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:185:11)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async fetchAmpRuntimeVersion_ (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:158:22)
    at async initRuntimeVersion (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:142:29)
    at async fetchRuntimeParameters (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:53:3)
    at async warmupCaches (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/warmup.js:57:5) {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/.cache'
}




AMP Optimizer ERROR Could not write cache file Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/.cache'
    at mkdirSync (fs.js:914:3)
    at FileSystemCache.set (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-core/lib/FileSystemCache.js:61:9)
    at fetchValidatorRulesFromCache_ (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:90:11)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async initValidatorRules (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:71:8) {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/.cache'
}




AMP Optimizer ERROR Could not write cache file Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/.cache'
    at mkdirSync (fs.js:914:3)
    at FileSystemCache.set (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-core/lib/FileSystemCache.js:61:9)
    at downloadAmpRuntimeStyles_ (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:244:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async fetchAmpRuntimeStyles_ (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:206:18)
    at async initRuntimeStyles (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:114:8)
    at async fetchRuntimeParameters (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/fetchRuntimeParameters.js:55:3)
    at async warmupCaches (/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/lib/warmup.js:57:5) {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/usr/local/lib/node_modules/blitz/node_modules/@ampproject/toolbox-optimizer/.cache'
}


AMP OPTIMIZER Downloaded latest AMP runtime data.

> @prisma/[email protected] postinstall /usr/local/lib/node_modules/blitz/node_modules/@prisma/sdk
> node scripts/download.js

version: 650b5d0348ec38ae61e1e7db69bb54808418ede4
Error: Can't write to /usr/local/lib/node_modules/blitz/node_modules/@prisma/sdk please make sure you install "@prisma/cli" with the right permissions.
    at downloadBinary (/usr/local/lib/node_modules/blitz/node_modules/@prisma/fetch-engine/dist/download.js:283:19)
    at /usr/local/lib/node_modules/blitz/node_modules/@prisma/fetch-engine/dist/download.js:101:59
    at Array.map (<anonymous>)
    at download (/usr/local/lib/node_modules/blitz/node_modules/@prisma/fetch-engine/dist/download.js:101:46)
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"<8.10.0"} (current: {"node":"12.18.0","npm":"6.14.7"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN [email protected] requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@>=16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@>=16.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.8.2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-dom@^16.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN @next/[email protected] requires a peer of react@^16.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN @next/[email protected] requires a peer of react-dom@^16.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] || 16.x.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @prisma/[email protected] postinstall: `node scripts/download.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @prisma/[email protected] postinstall 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!     /Users/wanshawn/.npm/_logs/2020-09-03T15_35_11_628Z-debug.log

Steps to Reproduce

  1. npm i -g blitz

Versions

current

Other

image
image

statudone

All 5 comments

Whoa, haven't seen that before!

Does this work? npx blitz new myapp

You can also try yarn global add blitz 馃し

i havent either. sudo has always worked for me, which is why its very odd to find it here. but cool i'll try npx

ok that worked. i'll close for now since i seem to be the only one with this problem but i think the underlying problem isnt solved yet

Just to mention, I am having the same issue, using yarn global add blitz didn't work for me, I am using npx instead.

Was this page helpful?
0 / 5 - 0 ratings