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 [email protected] No description npm WARN package.json [email protected] No repository field. npm WARN package.json [email protected] No README data npm WARN engine [email protected]: wanted: {"npm":">=3","node":">=6.5.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine [email protected]: wanted: {"npm":">=3","node":">=6.5.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine [email protected]: wanted: {"npm":">=3","node":">=6.5.0"} (current: {"node":"0.10.29","npm":"1.4.21"}) npm WARN engine [email protected]: wanted: {"node":">=0.12.0","iojs":">=1.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"})

[email protected] 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 [email protected]: wanted: {"node":">=0.12.0","iojs":">=1.0.0"} (current: {"node":"0.10.29","npm":"1.4.21"})

[email protected] 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. [email protected] node_modules/ethereumjs-util +-- [email protected] +-- [email protected] +-- [email protected] ([email protected], [email protected], [email protected], [email protected]) +-- [email protected] ([email protected], [email protected]) +-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) +-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) +-- [email protected] ([email protected], [email protected]) +-- [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

1 Answer 1

1

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

[email protected]: 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.
3
  • Yes, that was it! Everything works perfectly now. Thank you so much for the help. Jun 21, 2017 at 9:20
  • Did you use nvm or apt?
    – user67191
    Jun 21, 2017 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. Jun 22, 2017 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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