Not able to install truffle using npm install -g truffle

0 votes

I am trying to install truffle and when I run the mentioned command, I get this error:

$npm install -g truffle

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

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

/usr/local/lib

`-- truffle@4.1.14


npm ERR! Linux 4.15.0-39-generic

npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "truffle"

npm ERR! node v8.10.0

npm ERR! npm  v3.5.2

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!   errno: -13,

npm ERR!   code: 'EACCES',

npm ERR!   syscall: 'access',

npm ERR!   path: '/usr/local/lib/node_modules/truffle' }
Nov 29, 2018 in Blockchain by digger
• 26,740 points
4,640 views

1 answer to this question.

0 votes

You need root access to install truffle, run this command as root and in should work:

sudo npm install -g truffle
answered Nov 29, 2018 by Omkar
• 69,220 points
0 votes

You'd need root access to install truffle via the terminal.

Here's how to go about it, if you're running on a Windows OS.

Step 1: Run CMD as an administrator. You should find yourself in C:\Windows\system32> The "system32 folder".

Step 2: Run the following command in the terminal and let truffle complete its installation process. Make sure you are connected to the internet and in some cases after installation you'd see some error messages & warnings you can ignore them.

C:\Windows\system32>npm install -g truffle

Step 3:  Review your truffle environment || run "truffle version"

C:\Windows\system32>truffle version
Truffle v5.4.0 (core: 5.4.0)
Solidity v0.5.16 (solc-js)
Node v14.17.3
Web3.js v1.4.0

That's pretty much it on installing truffle in windows OS.

NOTE: You don't need root access before initializing a new truffle project.

answered Jul 14, 2021 by Dero Idoghor

edited Mar 5

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,220 points
2,433 views
0 votes
1 answer

Not able to send payments using Blockchain API.

Try the following code. It should help ...READ MORE

answered Jul 31, 2018 in Blockchain by slayer
• 29,370 points
784 views
0 votes
1 answer

Not able to run chaincode locally using docker

Looks like the Fabric team introduced "nopkcs11" ...READ MORE

answered Sep 18, 2018 in Blockchain by slayer
• 29,370 points
844 views
0 votes
1 answer

Not able to invoke a contract in Ethereum Private chain using geth

Hope this helps: contract mortal { /* ...READ MORE

answered Oct 22, 2018 in Blockchain by Omkar
• 69,220 points
1,092 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
2,045 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,575 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,651 views
–1 vote
1 answer

Not able to install truffle

I know this is very frustrating, I ...READ MORE

answered Jan 17, 2019 in Blockchain by Omkar
• 69,220 points
4,302 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,220 points
2,535 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