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
• 27,620 points

5 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
+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,040 points

selected May 5 by Omkar
+1 vote

Try installing truffle using the following commands:

$ npm install -g ethereumjs-testrpc
$ npm install -g truffle
answered May 5 by Firoz
+1 vote

Try installing truffle:

$ npm uninstall -g truffle
$ npm install -g truffle
answered May 5 by Jisha
0 votes

Try installing it like this using npx:

$ npx truffle@5.0.2 unbox pet-shop
answered May 5 by Umesh
0 votes

You can initiate truffle:

$ npm init truffle
answered May 5 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
• 27,620 points
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
0 votes
1 answer
0 votes
1 answer

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

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,320 points
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,040 points

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.