Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Truffle command not found after installation

Tags:

I installed truffle through npm with the following:

sudo npm install -g truffle

but when I run truffle list on the console it just gives me

bash: truffle: command not found

like image 773
user3480478 Avatar asked Jul 01 '16 14:07

user3480478


People also ask

How do I know if truffle is installed?

Open node. js command prompt and paste the following command in the prompt to install Truffle. After the download is complete, type “truffle version” on node terminal to verify that truffle is successfully installed.

Which is the command to install truffle?

If you'd like to configure a more advanced development environment we recommend you install the blockchain server separately by running npm install -g ganache at the command line. ganache: a command-line version of Truffle's blockchain server.

Can install truffle Windows 10?

I was able to get truffle installed on Windows 10 by going one version older. Ran PS in Administrator mode (With Execution Policy set to "ByPass"). Hope this helps.


1 Answers

I had a similar problem. I ran npm i -g truffle and then when I tried to run truffle init I got an error: zsh: command not found: truffle. What solved it for me is to create a local node_modules with truffle installed in it, and then run that copy.

  1. run npm init and make a new npm project
  2. run npm i truffle
  3. run ./node_modules/.bin/truffle init and it should work!
like image 84
drussell Avatar answered Sep 23 '22 01:09

drussell