Install error (EACCESS) with OpenZeppelin SDK 2.6

I am getting the following errors when upgrading to ozSDK 2.6

Command
npm uninstall -g @openzeppelin/cli
sudo npm install -D @openzeppelin/cli@2.6 --global

Error

npm WARN deprecated truffle-config@1.1.16: WARNING: This package has been renamed to @truffle/config.
npm WARN deprecated truffle-error@0.0.5: WARNING: This package has been renamed to @truffle/error.
npm WARN deprecated truffle-provider@0.1.16: WARNING: This package has been renamed to @truffle/provider.
npm WARN deprecated truffle-interface-adapter@0.2.5: WARNING: This package has been renamed to @truffle/interface-adapter.
/usr/local/bin/openzeppelin -> /usr/local/lib/node_modules/@openzeppelin/cli/lib/bin/oz-cli.js
/usr/local/bin/zos -> /usr/local/lib/node_modules/@openzeppelin/cli/lib/bin/oz-cli.js
/usr/local/bin/oz -> /usr/local/lib/node_modules/@openzeppelin/cli/lib/bin/oz-cli.js

> keccak@2.0.0 install /usr/local/lib/node_modules/@openzeppelin/cli/node_modules/keccak
> npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."


> keccak@2.0.0 rebuild /usr/local/lib/node_modules/@openzeppelin/cli/node_modules/keccak
> node-gyp rebuild

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/pk/Library/Caches/node-gyp/10.16.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@openzeppelin/cli/node_modules/keccak/.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/@openzeppelin/cli/node_modules/keccak/.node-gyp'
gyp ERR! System Darwin 19.0.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/@openzeppelin/cli/node_modules/keccak
gyp ERR! node -v v10.16.2
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keccak@2.0.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the keccak@2.0.0 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Keccak bindings compilation fail. Pure JS implementation will be used.

> secp256k1@3.7.1 install /usr/local/lib/node_modules/@openzeppelin/cli/node_modules/secp256k1
> npm run rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used."


> secp256k1@3.7.1 rebuild /usr/local/lib/node_modules/@openzeppelin/cli/node_modules/secp256k1
> node-gyp rebuild

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/pk/Library/Caches/node-gyp/10.16.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@openzeppelin/cli/node_modules/secp256k1/.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/@openzeppelin/cli/node_modules/secp256k1/.node-gyp'
gyp ERR! System Darwin 19.0.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/@openzeppelin/cli/node_modules/secp256k1
gyp ERR! node -v v10.16.2
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! secp256k1@3.7.1 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the secp256k1@3.7.1 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Secp256k1 bindings compilation fail. Pure JS implementation will be used.

> sha3@1.2.3 install /usr/local/lib/node_modules/@openzeppelin/cli/node_modules/sha3
> node-gyp rebuild

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/pk/Library/Caches/node-gyp/10.16.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@openzeppelin/cli/node_modules/sha3/.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/@openzeppelin/cli/node_modules/sha3/.node-gyp'
gyp ERR! System Darwin 19.0.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/@openzeppelin/cli/node_modules/sha3
gyp ERR! node -v v10.16.2
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3@1.2.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sha3@1.2.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!     /Users/pk/.npm/_logs/2019-11-21T00_46_16_412Z-debug.log
1 Like

Hi @pkr,

Sorry to hear that you are having issues installing OpenZeppelin SDK 2.6.

@gitpusha had similar issues and they were able to resolve by using nvm which is one of the recommended solutions in the npm documentation.
I suggest looking at the following reply:

Alternatively, instead of installing globally, you could install locally and then run via npx.

I hope this helps. Let me know how you get on.

Thank you @abcoathup for these links.

I tried sudo npm install --unsafe-perm --global @openzeppelin/cli

and it didn’t work either – getting the same error.

1 Like

Hi @pkr,

I answered in the other topic: