Truffle command not found after installation

╄→гoц情女王★ 提交于 2019-12-05 00:53:52

Please make sure you have the latest version of npm and node installed. I had the same issue, I updated npm and node to latest version and it worked.

npm install -g truffle works.

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!

I did it on a Virtual box and had the same issue, but it worked after I restarted the computer. Hopefully that works for you too

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!