bitcoinjs-lib: Installation fails with tiny-secp256k1 on node v10 for v10.9.0 and earlier
CXX(target) Release/obj.target/secp256k1/native/addon.o In file included from …/native/addon.cpp:4: …/…/nan/nan.h:1081:96: error: too many arguments to function call, expected at most 4, have 5 length_ = string->WriteUtf8(v8::Isolate::GetCurrent(), str_, static_cast<int>(len), 0, flags); ~~~~~~~~~~~~~~~~~ ^~~~~
Here is the final output of the error log:
5 warnings and 1 error generated. make: *** [Release/obj.target/secp256k1/native/addon.o] Error 1 gyp ERR! build error gyp ERR! stack Error:
make
failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/ariks/.nvm/versions/node/v10.9.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:239:12) gyp ERR! System Darwin 18.2.0 gyp ERR! command “/Users/ariks/.nvm/versions/node/v10.9.0/bin/node” “/Users/ariks/.nvm/versions/node/v10.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild” gyp ERR! cwd /Users/ariks/Developer/[…]/node_modules/tiny-secp256k1 gyp ERR! node -v v10.9.0 gyp ERR! node-gyp -v v3.7.0 gyp ERR! not oknpm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! tiny-secp256k1@1.0.1 install:
node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the tiny-secp256k1@1.0.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! /Users/ariks/.npm/_logs/2018-12-17T18_49_57_607Z-debug.log
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (8 by maintainers)
@aminmazi That error is not related to this issue. You may be using python 3 but it’s not supported by node-gyp.
It installs properly for me:
It seems to be fixed in nan@2.12.1 https://github.com/nodejs/nan/pull/833
The problem with npm is that lots of error messages appear, but that doesn’t mean the installation failed. Sometimes post-install scripts of certain dependencies are failing and reverting to some fallback etc.
npm install --no-progress --silent --no-audit
is the most quiet way to perform npm install…Then all you need to do is figure out if the command failed or succeeded… in bash (posix shells) that would be adding
&& echo SUCCESS
etc. since the command after && will only perform if the previous succeeded.For Windows, I don’t know how you’d do that.
Just incase anyone is having this issue and wants to fix it witout installing python 3, if you are using Anacode you can switch your env using command activate env-python-2.7 Assuming your python 2.7 environemnt name is env-python-2.7
see all available enviornments in Anaconda
conda env list
It seems that this issue can be closed? @junderw