简体   繁体   中英

how to run ethereumjs using NODE.JS

hi everyoune iam trying to work with ethereumjs

problem is i just cant run it by typing 'testrpc'

am getting the msg:

"'testrpc' is not recognized as an internal or external command, operable program or batch file."

any idea why?

thank u

this is my log:

:\\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>

I think you have to install it globally to run it like this . Or you can add the directory to your PATH :

Right click

My Computer' and go to Properties > Advanced System Settings > Environment Variables.

Double click on PATH under the 'User variables for Username' section, and add

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.

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

sudo npm install -g testrpc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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