Not able to install truffle

–1 vote

I am in a very frustrating situation. I am not able to install truffle. Command doesn't work as super-user and even as non super-user!!!!!!!!

As non super-user:

$ npm install -g truffle


npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/truffle

npm ERR! path /usr/local/lib/node_modules/truffle

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/truffle'

npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/truffle'

npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules/truffle\'',

npm ERR!   errno: -13,

npm ERR!   code: 'EACCES',

npm ERR!   syscall: 'access',

npm ERR!   path: '/usr/local/lib/node_modules/truffle' }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator (though this is not recommended).


npm ERR! A complete log of this run can be found in:

npm ERR!     /home/user/.npm/_logs/2019-01-17T09_08_20_188Z-debug.log

As a super user:

$ sudo npm install -g truffle


/usr/local/bin/truffle -> /usr/local/lib/node_modules/truffle/build/cli.bundled.js


> keccak@1.4.0 install /usr/local/lib/node_modules/truffle/node_modules/keccak

> npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."



> keccak@1.4.0 rebuild /usr/local/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/user/.node-gyp/8.10.0"

gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/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/local/lib/node_modules/truffle/node_modules/keccak/.node-gyp'

gyp ERR! System Linux 4.15.0-43-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/truffle/node_modules/keccak

gyp ERR! node -v v8.10.0

gyp ERR! node-gyp -v v3.8.0

gyp ERR! not ok

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! keccak@1.4.0 rebuild: `node-gyp rebuild`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the keccak@1.4.0 rebuild script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Jan 17, 2019 in Blockchain by digger
• 26,740 points
3,929 views

1 answer to this question.

0 votes

I know this is very frustrating, I have been there! Some tasks need super-user permissions and some doesn't allow super-user mode. 

Try this command, it worked for me:

sudo npm install --unsafe-perm -g truffle 

answered Jan 17, 2019 by Omkar
• 69,230 points
Worked for me too Thanks
Thank you, it works for me as well

Related Questions In Blockchain

0 votes
1 answer

Not able to install truffle

This error occurs when there are permission ...READ MORE

answered Jan 29, 2019 in Blockchain by Omkar
• 69,230 points
2,088 views
0 votes
1 answer

Hyperledger Composer: not able to install Hyperledger composer-cli

Try setting the PATH like this, export PATH="/usr/local/share/npm/bin:$PATH" Now run the ...READ MORE

answered Oct 31, 2018 in Blockchain by Omkar
• 69,230 points
1,515 views
0 votes
1 answer

Hyperledger Fabric: Not able to install docker

Clean up the invalid package repository: cd ../../etc/apt/sources.list.d sudo ...READ MORE

answered Nov 2, 2018 in Blockchain by Omkar
• 69,230 points
863 views
0 votes
1 answer

Not able to start testrpc for Ethereum truffle

Hey. It seems like you already have ...READ MORE

answered Nov 28, 2018 in Blockchain by Omkar
• 69,230 points
847 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,878 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,394 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,316 views
0 votes
1 answer

Not able to install truffle using npm install -g truffle

You need root access to install truffle, ...READ MORE

answered Nov 29, 2018 in Blockchain by Omkar
• 69,230 points
4,350 views
0 votes
1 answer

Not able to install truffle-contract

There’s a permission error. Run this command ...READ MORE

answered Jan 23, 2019 in Blockchain by Omkar
• 69,230 points
2,166 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP