How to solve truffle command not found error in blockchain

+1 vote

I am trying to install truffle on my Ubuntu system. I have used the following code to install truffle:

$ sudo npm install -g truffle

Now I am trying to run the truffle list command on the terminal but I get the following error on execution:

-bash: truffle: command not found

How can I solve this?

Jul 16, 2018 in Blockchain by digger
• 26,740 points
11,853 views

5 answers to this question.

+1 vote
Best answer

First try restarting the system and then execute this command.

If it does not work then try make a new npm project and keep the dependencies local. To do it, you run the following commands:

$ run npm init
$ run npm i truffle
$ run ./node_modules/.bin/truffle init

If both the above solutions do not work, then it should be some problem with the version. So, install the latest
version of npm and node. You can do it by running the following command:

$ npm install -g truffle
answered Jul 16, 2018 by slayer
• 29,370 points

selected May 6, 2019 by Omkar
+1 vote

Try installing truffle using the following commands:

$ npm install -g ethereumjs-testrpc
$ npm install -g truffle
answered May 6, 2019 by Firoz
+1 vote

Try installing truffle:

$ npm uninstall -g truffle
$ npm install -g truffle
answered May 6, 2019 by Jisha
0 votes

Try installing it like this using npx:

$ npx truffle@5.0.2 unbox pet-shop
answered May 6, 2019 by Umesh
0 votes

You can initiate truffle:

$ npm init truffle
answered May 6, 2019 by Hari

Related Questions In Blockchain

0 votes
1 answer

How to solve EACCES:permission denied error in Hyperledger Composer?

It seems like there is no required ...READ MORE

answered Jul 11, 2018 in Blockchain by digger
• 26,740 points
2,361 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,885 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,402 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,337 views
0 votes
1 answer

How to solve "error trying install composer runtime" in Hyperledger composer?

I think the docker-compose tool is not ...READ MORE

answered Jul 17, 2018 in Blockchain by slayer
• 29,370 points
861 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