- nodejs 3.10.9
- geth 1.4.18-stable-c72f5459
I did the folowing steps:
geth --testnet --rpc
- installed web3 via
npm install web3 -g.
- when I am in the node-console and run:
I get the error:
ReferenceError: web3 is not defined at repl:1:1 at REPLServer.defaultEval (repl.js:262:27) at bound (domain.js:287:14) at REPLServer.runBound [as eval] (domain.js:300:12) at REPLServer.<anonymous> (repl.js:431:12) at emitOne (events.js:82:20) at REPLServer.emit (events.js:169:7) at REPLServer.Interface._onLine (readline.js:211:10) at REPLServer.Interface._line (readline.js:550:8) at REPLServer.Interface._ttyWrite (readline.js:827:14)
When I run
require('web3') in node console I get the same error.
I also tried to install web3 without -g (
npm install web3); same result.
What am I doing wrong?
Why is web3 not recognized by node after the installation through
npm install web3 -g?
I tried to do the installation according to this thread: How to connect NodeJS to the Ethereum network?
and the documentation: https://www.npmjs.com/package/web3