Trying to follow the tutorial on Medium, I would like to open the truffle console (Ubuntu 16.04).

I get the following output:

mzh@021-voting $ truffle console
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/usr/lib/node_modules/truffle/node_modules/web3/lib/web3/errors.js:35:16)
    at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:116:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpRequestError (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:544:12)
    at ClientRequest.<anonymous> (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:414:24)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.socketErrorListener (_http_client.js:310:9)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1281:8)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)
mzh@021-voting $
mzh@021-voting $ npm -version

mzh@021-voting $ truffle -version
Truffle v3.1.1 - a development framework for Ethereum

Usage: truffle <command> [options]

  init      Initialize new Ethereum project with example contracts and tests
  compile   Compile contract source files

Can't find any information about problems with the truffle console on the web. Anyone had the same problem?

  • my truffle -version returns Truffle v3.4.9, maybe it's just a matter of updating it? – manuhalo Oct 29 '17 at 17:13
  • I actually downdated it to be in sync with the tutorial, but I'll try – TMOTTM Oct 29 '17 at 17:20
  • Nice, truffle 3.4.11 works. Also testrpc is running concurrently. Seems to be required. – TMOTTM Oct 29 '17 at 17:22
  • yes, truffle console needs an eth client (testrpc or geth or similar) to send its commands to. With truffle 4.0 the plan is to have a sort of minimal testrpc bundled with truffle so you do not need to install anything else for testing purposes. See github.com/trufflesuite/truffle/releases for more info. – manuhalo Oct 29 '17 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.