如何使用NODE.JS运行ethereumjs

时间:2017-11-14 13:55:10

标签: node.js npm blockchain ethereum

大家好,我试图与ethereumjs合作

问题是我不能通过输入' testrpc'

来运行它

我正在收到消息:

"' testrpc'不被视为内部或外部命令, 可操作的程序或批处理文件。"

任何想法为什么?

谢谢你

这是我的日志:

:\ Users \ david \ Documents \ Visual Studio 2015 \ Projects \ assignment_2> npm install 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>

2 个答案:

答案 0 :(得分:0)

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

右键单击

我的电脑'并转到Properties > Advanced System Settings > Environment Variables.

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

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

显然用你的'用户名'替换。

重新启动控制台窗口或IDE,您应该从bower命令获得响应。

答案 1 :(得分:0)

您需要在系统上全局安装testrpc ...

sudo npm install -g testrpc