1

I am running into permission issues when I try to install truffle

avi@avi-Inspiron-3542:~$ sudo npm install -g truffle /usr/bin/truffle -> /usr/lib/node_modules/truffle/build/cli.bundled.js 

[email protected] install /usr/lib/node_modules/truffle/node_modules/keccak npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."

[email protected] rebuild /usr/lib/node_modules/truffle/node_modules/keccak node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/avi/.node-gyp/11.6.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/truffle/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/lib/node_modules/truffle/node_modules/keccak/.node-gyp' gyp ERR! System Linux 4.15.0-29-generic gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/lib/node_modules/truffle/node_modules/keccak gyp ERR! node -v v11.6.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] rebuild: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] rebuild 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/avi/.npm/_logs/2019-01-05T10_04_02_789Z-debug.log Keccak bindings compilation fail. Pure JS implementation will be used. + [email protected] added 90 packages from 305 contributors in 7.547s 
4
  • Try installing it without sudo . From the error root doesnt have access to /home/avi/. I would also check what the permission are on that folder ls -lHf Commented Jan 5, 2019 at 10:13
  • and why not just npm install -g truffle ? Commented Jan 5, 2019 at 10:14
  • if this keeps playing up, take out the g flag and install it locally in folder while you result your persmission issues npm install truffle Commented Jan 5, 2019 at 10:17
  • ok thanks @Data_Kid, I will try those commands. I appreciate your help Commented Jan 6, 2019 at 11:50

1 Answer 1

2

The issue is more node / npm related than it is blockchain.

Its to do with a difference between your version of node and the gyp version

run:

sudo npm install -g truffle --unsafe-perm 

It should work now

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.