【问题标题】:Running Testrpc and truffle from powershell not working从powershell运行Testrpc和truffle不起作用
【发布时间】:2017-03-08 09:08:35
【问题描述】:

我正在安装以太坊开发所需的一些模块/包,并且我之前安装了 truffle 和 testrpc,我可以在 PowerShell 中正常运行它们。我现在突然无法运行,因为它说“testrpc”未被识别为 cmdlet,“松露”未被识别为 cmdlet。我将不胜感激有关如何/为什么发生这种情况以及如何解决它的帮助。我也尝试重新启动我的设备,但这没有帮助。 Error produced when I run the script/command

【问题讨论】:

  • 您能否发布您正在尝试的命令以及所述错误消息的副本,以帮助尝试帮助您诊断问题的人?提前致谢。
  • 谢谢我已经修改了。
  • 你是如何安装 truffletestrpc 的,这是通过 Chocolatey 吗?你说你以前安装过它们,是多久以前的?跨度>
  • 是的,我通过巧克力通过 powershell 安装了它们。
  • 更正我通过 npm 而不是 choco 安装它们,我通过 choco 安装了 nodejs、git 和 Visual Studio 代码。

标签: powershell ethereum truffle consensys-truffle


【解决方案1】:

如果之前运行正常,卸载并重新安装 truffle 应该可以正常工作。 npm 卸载 -g 松露 npm install -g 松露

如果这不起作用,下面将起作用。

run npm init #this will make a new npm project particularly package.json
run npm i truffle #this will download node modules 
run ./node_modules/.bin/truffle init #this will create a truffle project

【讨论】:

    猜你喜欢
    • 2019-05-24
    • 2018-02-15
    • 1970-01-01
    • 2023-03-19
    • 1970-01-01
    • 1970-01-01
    • 2020-11-24
    • 2022-08-10
    • 2014-11-07
    相关资源
    最近更新 更多