npm install sha3 fails - node10/npm6
See original GitHub issueTraceback:
sha3@1.2.0 install /Users/noahzinsmeister/Documents/github/smart-contracts/snowflake_poc/node_modules/sha3 node-gyp rebuild
CXX(target) Release/obj.target/sha3/src/addon.o
…/src/addon.cpp:59:36: error: no matching member function for call to ‘NewInstance’
info.GetReturnValue().Set(cons->NewInstance(argc, argv));
~~~~
/Users/noahzinsmeister/.node-gyp/10.0.0/include/node/v8.h:3851:44: note: candidate function not viable: requires single argument ‘context’, but 2 arguments were provided
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
^
/Users/noahzinsmeister/.node-gyp/10.0.0/include/node/v8.h:3848:44: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
^
1 error generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: ^make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command “/usr/local/Cellar/node/10.0.0/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
gyp ERR! cwd /Users/noahzinsmeister/Documents/github/smart-contracts/snowflake_poc/node_modules/sha3
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:27
@bladexxv Since this issue doesn’t manifest until Node.js 10.x, a workaround would be to downgrade to Node.js 9.11.1 (the previous non-LTS release) or 8.11.1 (the current LTS release).
The minimum path to fixing this issue altogether in Node.js 10.x would be:
sha3
package to npm would need to publish the new patch version to npm.I followed @canterberry steps, but it didn’t work in my case unfortunately. I was forced to downgrade node to 11.13.0
Steps I followed to downgrade from node 12 to 11:
sudo npm install -g n
install a program called nsudo n 11.13.0
downgrading node to 11.13.0rm -fR node_modules
cleaning dependenciesnpm install
reinstall dependenciesBTW - I am on mac