-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm install sha3 fails - node10/npm6 #32
Comments
Having the same issue. |
Working on porting this implementation to pure JavaScript, removing the C compilation steps from installation and alleviating this issue. |
@canterberry any ETA on the port? I might have some time to help out this weekend. Also, will we even be able to merge the PR? The repo hasn't been updated in ages, I don't know if anyone who has push access is still around. |
Even though this particular repo has been stable for 3 years, this is a serious enough compatibility issue that it'll warrant an update to be fixed. A direct solution for this issue might be to modernize the node-gyp layer to be compatible with Node.js 10.x which has evolved RE the JavaScript port: I'm hoping to have something working this weekend. Even though it's a port, the work is a tad ambitious, so I'm not holding my breath for it being incorporated any time in the immediate future. While I'm aiming to keep with an identical API and functionality to this library, I think the best course of action may be to develop it as a drop-in replacement for this library, with the hope of proposing to incorporate it here when it's ready. |
have same issue here. wow, real big issue... How to fix? |
@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:
|
It fails with
too. |
Have the same issue with:
After I downgrade the node version to |
|
Hi everyone, The problem seems to have something to do with sha3 and node-gyp. I saw this issue which seems to be related. Can anyone please help me out or point me to a solution for macOS with my node and npm versions? error message: npm ERR! code ELIFECYCLE |
Yeah, the problem is that As a workaround, you can try |
Hi @canterberry thank you for offering your help. Unfortunately npm install sha3@2.0.2 into my project directory did not resolve the issue with npm install web3 for me. I am relatively new to node, so no idea if this makes sense, but could I somehow use a separate older version of node in this project directory, to . be able to npm install web3 again? npm ERR! code ELIFECYCLE |
Ah, I was hoping it was that easy. Apparently not! Have a look at the (TIL how to force transitive dependency resolutions in npm and yarn.) TL;DR:
|
Hi @canterberry. Thanks again for your efforts. I followed your guidance and
still get the same error message unfortunately. Anything else you can spot here before I move over to Yarn? Thanks for all the help again. |
In trying to reproduce this locally (i.e: installing web3 from scratch in an empty project using Node.js 12.1.0 via a simple The steps you followed look correct, but I tried following them, myself, and saw this warning in the console:
Apparently both There doesn't appear to be a workaround, then, for using web3 on Node.js 12.x. The only solution may be to submit a PR to web3 that migrates its dependencies to alternatives (or newer versions) which do not depend on the |
@bytezantium v1.2.3 has been released. Please give that a shot (via the same steps outline above). Since |
Hi @canterberry . Sorry I only went back now to check again. You are the real MVP for taking all this time helping and fixing this. So bad news: it still wont work with web3@1.0.0-beta.35 - do you know why? GOOD NEWS: it does indeed work now with latest web3 (beta.55). Thanks so much! |
😄 Thanks! Dealing with the Rube Goldberg of the npm dependency graph can be rough, so thanks for your patience. I'm confident that I've done what I can, within the scope of this package, for compatibility with all (known) environments. The rest depends on maintainers of the individual packages. web3@1.0.0-beta.35 is unlikely to ever work in Node.js 12.x because of its dependency on scrypt, which appears to have been abandoned for several years. Since then, web3 seems to have removed its dependency on this package (sha3), and has made scrypt an optional dependency (?) so that its inevitable build failure on Node.js 12.x no longer causes the web3 install itself to fail. |
thanks a lot for your input on this! |
phusion/node-sha3#32 If this does not work, we may have to investigate upgrading to Web3 Beta55 sooner than we expected.
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:
BTW - I am on mac |
The latest version, sha3@1.2.3 (aka: @Juan-cc Can you provide some more details for your use case? Namely:
|
@canterberry please find my answers below
|
Strange -- in the screenshot for (4), I see the path is "/usr/local/Cellar/node/12.6.0/bin/node", but below I can see In attempting to reproduce this locally, but on Linux, I see the following:
This does not produce a build failure for me, but I am seeing a deprecation warning. In Node.js 12.3.0, I do see a build error:
Node.js 12.4.0, 12.5.0, and 12.6.0, however, appear to build without errors (although the deprecation warnings are still present). I have (and continue) to strongly advise package maintainers to migrate to v2.x of this package, which is a pure JavaScript implementation that does not suffer from drift in the node-gyp library and Python/C build toolchain and thus does not suffer from intermittent build failures due to changes in the Node.js and node-gyp toolchain. |
Created #60 to capture this defect, as it represents a different occurrence of this symptom. |
@Juan-cc In re-reading this topic, I noticed you downgraded to Node.js v11.x. Fair warning, this version of Node.js is no longer supported by the Node.js team. v12.x, v10.x, and v8.x all remain currently active, though. I've opened PR #61 to start down the path toward resolving the deprecation warnings, and hopefully toward resolving your issue and that of others who may be experiencing it. |
@Juan-cc It looks like there are no deprecation warnings or errors in the Travis CI build on Node.js 12.7.0. The build output looks sparkly clean across all supported Node.js versions, but I'm definitely seeing different results locally. This indicates a compatibility issue with the C++ compiler rather than with Node.js, the V8/add-ons API, or node-gyp. Which C compiler are you using? (i.e: the output of Travis CI: (no errors or warnings)
My local environment: (deprecation warnings, no errors)
|
Hi @canterberry , first of all thanks for taking the time to help with this issue.
|
Resolves to updated version of sha3 that doesn't break See phusion/node-sha3#33 and phusion/node-sha3#32 (comment) for details
Resolves to updated version of sha3 that doesn't break See phusion/node-sha3#33 and phusion/node-sha3#32 (comment) for details
I tried a bunch of node resolutions, tracing through
as well as adding this to |
Traceback:
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 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 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: 2gyp 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
The text was updated successfully, but these errors were encountered: