gpt4 book ai didi

node.js - 如何使用 NODE.JS 运行 ethereumjs

转载 作者:太空宇宙 更新时间:2023-11-04 01:57:40 25 4
gpt4 key购买 nike

大家好,我正在尝试使用 ethereumjs

问题是我无法通过输入“testrpc”来运行它

正在收到消息:

“‘testrpc’未被识别为内部或外部命令,可运行的程序或批处理文件。”

知道为什么吗?

谢谢你

这是我的日志:

:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2>npm 安装 ethereumjs-testrpc

> fsevents@1.1.3 install C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2\node_modules\fsevents
> node install


> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js

npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2\package.json'
npm WARN assignment_2 No description
npm WARN assignment_2 No repository field.
npm WARN assignment_2 No README data
npm WARN assignment_2 No license field.

+ ethereumjs-testrpc@6.0.1
added 368 packages in 31.206s

C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2>npm install
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2\package.json'
npm WARN assignment_2 No description
npm WARN assignment_2 No repository field.
npm WARN assignment_2 No README data
npm WARN assignment_2 No license field.

up to date in 2.663s

C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2>testrpc
'testrpc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2>tgestrpc -p
'tgestrpc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2>testrpc
'testrpc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2>$ npm install truffle
'$' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2> npm install truffle
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2\package.json'
npm WARN assignment_2 No description
npm WARN assignment_2 No repository field.
npm WARN assignment_2 No README data
npm WARN assignment_2 No license field.

+ truffle@4.0.1
added 55 packages in 9.487s

C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2>testrpc
'testrpc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2>testrpc
'testrpc' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\david\Documents\Visual Studio 2015\Projects\assignment_2>

最佳答案

我认为你必须全局安装它才能像这样运行它。或者您可以将该目录添加到您的 PATH 中:

右键单击

“我的电脑”,然后转到属性 > 高级系统设置 > 环境变量。

双击“用户名的用户变量”部分下的 PATH,然后添加

C:\Users\username\AppData\Roaming\testrpc

显然将“用户名”替换为您的。

重新启动控制台窗口或 IDE,您应该会收到 Bower 命令的响应。

关于node.js - 如何使用 NODE.JS 运行 ethereumjs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47287627/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com