I installed v3.0.2 on Ubuntu 15.10, and when I launch testrpc I get:
$ testrpc
/usr/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/index.js:29
function VM (opts = {}) {
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/hooked.js:6:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
TestRPC should start.
It fails immediately on start.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily
$ nodejs --version
v4.4.7
$ sudo npm -g install [email protected]
$ testrpc
/usr/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/index.js:29
function VM (opts = {}) {
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/hooked.js:6:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
I have to fallback to v2.0.9
This is a duplicate of #206. Unfortunately ethereumjs-vm has upgraded their code to ES6 now that Node 6.9.1 is set for long term support. You'll need to upgrade your node version to 6.x or above (I believe) in order to use the TestRPC at this time.
There are ways around this as mentioned in #206. Alternatively you can write a Node script that launches a TestRPC server and registers with Babel at the top of the file, which will convert ES6 code to ES5.
The address has changed a bit:
OS: Ubuntu 16.04 64bit
wget https://nodejs.org/dist/v8.8.0/node-v8.8.0-linux-x86.tar.gz
sudo tar -C /usr/local --strip-components 1 -xzf node-v8.8.0-linux-x86.tar.gz
I highly recommend creationix/nvm for anyone having this issue.
nvm install lts
nvm use lts
npm install -g ethereumjs-testrpc
benjamincburns suggestion of using nvm solved the issue for me, thanks!
Most helpful comment
This is a duplicate of #206. Unfortunately ethereumjs-vm has upgraded their code to ES6 now that Node 6.9.1 is set for long term support. You'll need to upgrade your node version to 6.x or above (I believe) in order to use the TestRPC at this time.
There are ways around this as mentioned in #206. Alternatively you can write a Node script that launches a TestRPC server and registers with Babel at the top of the file, which will convert ES6 code to ES5.