0

I need to install the npm package ethereumjs-util which will not install on my raspberry pi. I am using a pi 2 with raspbian. The following is the terminal output. Please tell me what I need to do to get a successful install. Thanks for the help.

pi@raspberrypi:~/Transaction $ npm install ethereumjs-util --save npm WARN package.json keypairs@1.0.0 No description npm WARN package.json keypairs@1.0.0 No repository field. npm WARN package.json keypairs@1.0.0 No README data npm WARN engine ethjs-util@0.1.4: wanted: {"npm":">=3","node":">=6.5.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine keccak@1.3.0: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine secp256k1@3.3.0: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine strip-hex-prefix@1.0.0: wanted: {"npm":">=3","node":">=6.5.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine is-hex-prefixed@1.0.0: wanted: {"npm":">=3","node":">=6.5.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine deep-extend@0.4.2: wanted: {"node":">=0.12.0","iojs":">=1.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"})

keccak@1.3.0 install /home/pi/Transaction/node_modules/ethereumjs-util/node_modules/keccak prebuild-install || node-gyp rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used." prebuild-install info begin Prebuild-install version 2.1.2 prebuild-install info looking for local prebuild @ prebuilds/keccak-v1.3.0-node-v11-linux-arm.tar.gz prebuild-install info looking for cached prebuild @ /home/pi/.npm/_prebuilds/https-github.com-cryptocoinjs-keccak-releases-download-v1.3.0-keccak-v1.3.0-node-v11-linux-arm.tar.gz prebuild-install http request GET https://github.com/cryptocoinjs/keccak/releases/download/v1.3.0/keccak-v1.3.0-node-v11-linux-arm.tar.gz prebuild-install http 404 https://github.com/cryptocoinjs/keccak/releases/download/v1.3.0/keccak-v1.3.0-node-v11-linux-arm.tar.gz prebuild-install WARN install No prebuilt binaries found (target=0.10.29 runtime=node arch=arm platform=linux) make: Entering directory '/home/pi/Transaction/node_modules/ethereumjs-util/node_modules/keccak/build' CXX(target) Release/obj.target/keccak/src/addon.o In file included from ../src/addon.cc:2:0: ../node_modules/nan/nan.h:326:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’ static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8; ^ keccak.target.mk:100: recipe for target 'Release/obj.target/keccak/src/addon.o' failed make: *** [Release/obj.target/keccak/src/addon.o] Error 1 make: Leaving directory '/home/pi/Transaction/node_modules/ethereumjs-util/node_modules/keccak/build' ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12) gyp ERR! System Linux 4.4.50-v7+ gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /home/pi/Transaction/node_modules/ethereumjs-util/node_modules/keccak gyp ERR! node -v v0.10.29 gyp ERR! node-gyp -v v0.12.2 gyp ERR! not ok Keccak bindings compilation fail. Pure JS implementation will be used.

npm WARN engine deep-extend@0.4.2: wanted: {"node":">=0.12.0","iojs":">=1.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"})

secp256k1@3.3.0 install /home/pi/Transaction/node_modules/ethereumjs-util/node_modules/secp256k1 prebuild-install || node-gyp rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used." prebuild-install info begin Prebuild-install version 2.1.2 prebuild-install info looking for local prebuild @ prebuilds/secp256k1-v3.3.0-node-v11-linux-arm.tar.gz prebuild-install info looking for cached prebuild @ /home/pi/.npm/_prebuilds/https-github.com-cryptocoinjs-secp256k1-node-releases-download-v3.3.0-secp256k1-v3.3.0-node-v11-linux-arm.tar.gz prebuild-install http request GET https://github.com/cryptocoinjs/secp256k1-node/releases/download/v3.3.0/secp256k1-v3.3.0-node-v11-linux-arm.tar.gz prebuild-install http 404 https://github.com/cryptocoinjs/secp256k1-node/releases/download/v3.3.0/secp256k1-v3.3.0-node-v11-linux-arm.tar.gz prebuild-install WARN install No prebuilt binaries found (target=0.10.29 runtime=node arch=arm platform=linux) make: Entering directory '/home/pi/Transaction/node_modules/ethereumjs-util/node_modules/secp256k1/build' CXX(target) Release/obj.target/secp256k1/src/addon.o In file included from ../src/addon.cc:2:0: ../node_modules/nan/nan.h:326:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’ static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8; ^ secp256k1.target.mk:124: recipe for target 'Release/obj.target/secp256k1/src/addon.o' failed make: *** [Release/obj.target/secp256k1/src/addon.o] Error 1 make: Leaving directory '/home/pi/Transaction/node_modules/ethereumjs-util/node_modules/secp256k1/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12) gyp ERR! System Linux 4.4.50-v7+ gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /home/pi/Transaction/node_modules/ethereumjs-util/node_modules/secp256k1 gyp ERR! node -v v0.10.29 gyp ERR! node-gyp -v v0.12.2 gyp ERR! not ok Secp256k1 bindings compilation fail. Pure JS implementation will be used. ethereumjs-util@5.1.2 node_modules/ethereumjs-util +-- rlp@2.0.0 +-- bn.js@4.11.6 +-- create-hash@1.1.3 (inherits@2.0.3, cipher-base@1.0.3, ripemd160@2.0.1, sha.js@2.4.8) +-- ethjs-util@0.1.4 (is-hex-prefixed@1.0.0, strip-hex-prefix@1.0.0) +-- keccak@1.3.0 (bindings@1.2.1, inherits@2.0.3, safe-buffer@5.1.0, nan@2.6.2, prebuild-install@2.1.2) +-- secp256k1@3.3.0 (bindings@1.2.1, bip66@1.1.5, safe-buffer@5.1.0, drbg.js@1.0.1, nan@2.6.2, prebuild-install@2.1.2, elliptic@6.4.0) +-- babelify@7.3.0 (object-assign@4.1.1, babel-core@6.25.0) +-- babel-preset-es2015@6.24.1 (babel-plugin-transform-es2015-literals@6.22.0, babel-plugin-transform-es2015-object-super@6.24.1, babel-plugin-transform-es2015-block-scoping@6.24.1, babel-plugin-transform-es2015-destructuring@6.23.0, babel-plugin-transform-es2015-duplicate-keys@6.24.1, babel-plugin-transform-es2015-modules-umd@6.24.1, babel-plugin-transform-es2015-shorthand-properties@6.24.1, babel-plugin-transform-es2015-block-scoped-functions@6.22.0, babel-plugin-transform-es2015-parameters@6.24.1, babel-plugin-transform-es2015-modules-systemjs@6.24.1, babel-plugin-check-es2015-constants@6.22.0, babel-plugin-transform-es2015-spread@6.22.0, babel-plugin-transform-es2015-arrow-functions@6.22.0, babel-plugin-transform-es2015-unicode-regex@6.24.1, babel-plugin-transform-regenerator@6.24.1, babel-plugin-transform-es2015-modules-commonjs@6.24.1, babel-plugin-transform-es2015-for-of@6.23.0, babel-plugin-transform-es2015-function-name@6.24.1, babel-plugin-transform-es2015-sticky-regex@6.24.1, babel-plugin-transform-es2015-classes@6.24.1, babel-plugin-transform-es2015-modules-amd@6.24.1, babel-plugin-transform-es2015-typeof-symbol@6.23.0, babel-plugin-transform-es2015-template-literals@6.22.0, babel-plugin-transform-es2015-computed-properties@6.24.1)

1

The problem here is that you are using an older version of node. The important line is this one:

ethjs-util@0.1.4: wanted: {"npm":">=3","node":">=6.5.0"} (current: {"node":"0.10.29","npm":"1.4.21"})

ethjs-util requires at least npm 3 and node 6.5.0.

To fix:

  1. Remove the older version of node:

    sudo apt purge nodejs
    
  2. Install a newer version of node. There are two ways that you can do this.

    • Install using nvm
    • Install using apt


    NOTE: If you want to keep node fully updated, you should use nvm. If you use apt you have to keep adding repositories every time a new major release comes out.

Install using nvm:

Install using apt:

  • Add the NodeSource repository

    sudo curl -sL https://deb.nodesource.com/setup_8.x | bash
    
  • Install by running sudo apt install node nodejs npm

    1. Now run npm install ethereumjs-util.
  • Yes, that was it! Everything works perfectly now. Thank you so much for the help. – John Shearing Jun 21 '17 at 9:20
  • Did you use nvm or apt? – user67191 Jun 21 '17 at 9:22
  • nvm as you recommended. Your instructions have been imortalized here for anyone who wants to use a pi to make Ethereum transactions without exposing their private keys to the Internet. – John Shearing Jun 22 '17 at 6:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.