node-sha3: Failed at the sha3@1.2.0 install script 'node-gyp rebuild'.

I was trying to install Truffle and I got the following error:

node-sass@3.8.0 postinstall /usr/lib/node_modules/truffle/node_modules/truffle-default-builder/node_modules/node-sass node scripts/build.js

“/usr/lib/node_modules/truffle/node_modules/truffle-default-builder/node_modules/node-sass/vendor/linux-x64-46/binding.node” exists. testing binary. Binary is fine; exiting. npm ERR! Linux 3.16.0-4-amd64 npm ERR! argv “/usr/bin/nodejs” “/usr/bin/npm” “install” “-g” “truffle” npm ERR! node v4.5.0 npm ERR! npm v2.15.9 npm ERR! code ELIFECYCLE

npm ERR! sha3@1.2.0 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sha3@1.2.0 install script ‘node-gyp rebuild’. npm ERR! This is most likely a problem with the sha3 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs sha3 npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm ERR! npm owner ls sha3 npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/user/Projects/WeatherContractBlock/npm-debug.log

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 20
  • Comments: 43

Commits related to this issue

Most upvoted comments

Resolved : sudo apt-get install build-essential

I had the same issue. The sha3 package was included in another dependency I have added to my package.json. I cannot really explain why but the error disappeared after running

npm i sha3 --save
npm i

Hope that helps

sudo apt-get install libgmp-dev solved the issue for me

For Red Hat distributions (for example, CentOS) it will be sudo yum groupinstall 'Development Tools'.

I had the same issue with sha3. So to diagnose it try running npm install sha3

The error messages were more specific. Turns out I had to install Python 2.7.x (and add to path before Python v3 location)

Hope this can help someone.

I’m running Windows10, Node v7.2.0 and Npm v3.10.9

I am having the same issue with keccak

Resolved : sudo apt-get install build-essential

This saves my day. Thank you.

gyp ERR! configure error gyp ERR! stack Error: Can’t find Python executable “f:\ProgramData\Anaconda3\python.EXE”, you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19) gyp ERR! stack at PythonFinder.<anonymous> (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16) gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21) gyp ERR! System Windows_NT 10.0.15063 gyp ERR! command “D:\Program Files\nodejs\node.exe” “D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild” gyp ERR! cwd D:\Projects\browser-solidity\node_modules\sha3 gyp ERR! node -v v8.2.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok

Downgrading from Node 12 to Node 10 fixed this for me 👍

For people still in pain (like I was). I resolved the build error by making sure the g++ command was resolvable. Read: https://github.com/0mkara/etheratom/issues/88#issuecomment-384570317

@luclu Did you ever resolve your issue? unterminated #ifndef? I’m currently seeing this every ~5 builds (same as you), and have not yet determined the cause…

for me it failed on windows because:

npm install sha3
...
\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Python executable "E:\Python\python.EXE" is v3.6.1, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js

So I uninstalled mine and installed 2.7 https://www.python.org/download/releases/2.7/ Then it worked.

I’m also experiencing this issue, on both travis-ci and heroku.