安装后未找到松露命令 [英] Truffle command not found after installation
本文介绍了安装后未找到松露命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通过npm
通过以下方式安装了松露:
I installed truffle through npm
with the following:
sudo npm install -g松露
sudo npm install -g truffle
但是当我在控制台上运行松露列表时,它只是给了我
but when I run truffle list on the console it just gives me
重击:松露:找不到命令
bash: truffle: command not found
推荐答案
我遇到了类似的问题.我运行了npm i -g truffle
,然后尝试运行truffle init
时出现错误:zsh: command not found: truffle
.为我解决的是创建一个安装了松露的本地node_modules,然后运行该副本.
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.
- 运行
npm init
并创建一个新的npm项目 - 运行
npm i truffle
- 运行
./node_modules/.bin/truffle init
,它应该可以工作!
- run
npm init
and make a new npm project - run
npm i truffle
- run
./node_modules/.bin/truffle init
and it should work!
这篇关于安装后未找到松露命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文