简体   繁体   English

如何使用NODE.JS运行ethereumjs

[英]how to run ethereumjs using NODE.JS

hi everyoune iam trying to work with ethereumjs 大家好,IAM尝试与ethereumjs合作

problem is i just cant run it by typing 'testrpc' 问题是我无法通过键入“ testrpc”来运行它

am getting the msg: 正在获取味精:

"'testrpc' is not recognized as an internal or external command, operable program or batch file." “'testrpc'无法识别为内部或外部命令,可操作程序或批处理文件。”

any idea why? 知道为什么吗?

thank u 感谢你

this is my log: 这是我的日志:

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

I think you have to install it globally to run it like this . 我认为您必须全局安装它才能像这样运行它。 Or you can add the directory to your PATH : 或者,您可以将目录添加到PATH

Right click 右键点击

My Computer' and go to Properties > Advanced System Settings > Environment Variables. 我的电脑”,然后转到Properties > Advanced System Settings > Environment Variables.

Double click on PATH under the 'User variables for Username' section, and add 双击“用户名的用户变量”部分下的PATH,然后添加

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

obviously replacing 'username' with yours. 显然将“用户名”替换为您的用户名。

Restart your console window or IDE and you should get a response from the bower command. 重新启动控制台窗口或IDE,您应该从bower命令获得响应。

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

sudo npm install -g testrpc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM