How to run ethereumjs using Node.JS

+3 votes

Hi everyone, I am trying to work with ethereumjs and problem is that I just can't 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  and this is my log: :\Users\gabriel\Documents\Visual Studio 2015\Projects\assignment_2>npm install ethereumjs-testrpc

fsevents@1.1.3 install C:\Users\gabriel\Documents\Visual Studio 2015\Projects\assignment_2\node_modules\fsevents
> node install
> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\gabriel\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\gabriel\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\gabriel\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\gabriel\Documents\Visual Studio 2015\Projects\assignment_2>npm install
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\gabriel\Documents\Visual Studio 2015\Projects\assignment_2\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\gabriel\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\gabriel\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\gabriel\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\gabriel\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\gabriel\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\gabriel\Documents\Visual Studio 2015\Projects\assignment_2> npm install truffle
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\gabriel\Documents\Visual Studio 2015\Projects\assignment_2\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\gabriel\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.487
Mar 27, 2018 in Blockchain by Gabriel
• 680 points
119 views

2 answers to this question.

+2 votes
Best answer

You need to install testrpc globally on your system...

sudo npm install -g testrpc

I think you have to install testrpc globally to run it like this. Try running 

runas /noprofile /user:Administrator cmd 

and then:

npm install -g testrpc

 Or you can add the directory to your PATH:

  1. Right click
  2. My Computer' and go to Properties > Advanced System Settings > Environment Variables.
  3. Double click on PATH under the 'User variables for Username' section, and add:
    C:\Users\username\AppData\Roaming\testrpc
  4. Make sure to replace 'username' with your username.
  5. Restart your console window or IDE and you should get a response from the bower command.

Hope it helps

answered Mar 27, 2018 by ned_crew
• 1,620 points

selected Aug 3, 2018 by Omkar
+1 vote
You can use Ethereum on nodejs and this link would be helpful for you: https://medium.com/@codetractio/try-out-ethereum-using-only-nodejs-and-npm-eabaaaf97c80
answered Oct 11, 2018 by Anmol

Related Questions In Blockchain

+2 votes
3 answers
0 votes
1 answer

How to create tokens in smart contracts from node.js?

Any modification to the Ethereum Blockchain will ...READ MORE

answered Jun 26, 2018 in Blockchain by Shashank
• 10,330 points
118 views
0 votes
1 answer

How to send Bitcoins with node.js?

This website https://blockr.io/tx/push will successfully do the bitcoin transaction. You ...READ MORE

answered Jul 20, 2018 in Blockchain by Christine
• 15,790 points
286 views
0 votes
1 answer

How to add https security for Node js?

You need to add the key and cert to the createServer function. const options ...READ MORE

answered Aug 10, 2018 in Blockchain by digger
• 27,620 points
34 views
0 votes
1 answer
0 votes
1 answer

Hyperledger Composer rest server NPM versions

The Hyperledger Composer pre-requisites can be installed ...READ MORE

answered Jul 13, 2018 in Blockchain by Christine
• 15,790 points
76 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
105 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 27,620 points
2,100 views
+1 vote
1 answer