Skip to content
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

Installation fails with tiny-secp256k1 on node v10 for v10.9.0 and earlier #1288

Closed
arik-so opened this issue Dec 17, 2018 · 16 comments
Closed
Assignees

Comments

@arik-so
Copy link
Contributor

arik-so commented Dec 17, 2018

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(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 ok

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

@junderw
Copy link
Member

junderw commented Dec 18, 2018

I'll look into it.

@junderw
Copy link
Member

junderw commented Dec 18, 2018

This broke as well.

$ node -v
v10.9.0
$ node-gyp -v
v3.0.3

But this installed fine.

$ node -v
v10.13.0
$ node-gyp -v
v3.0.3

I also tested against v10.14.2 and it worked.

Could you try installing the latest node?

$ nvm install v10 # installs latest v10 variant.

@junderw
Copy link
Member

junderw commented Dec 18, 2018

looks like a bug with v10.9.0...

@junderw junderw changed the title Installation fails for tiny-secp256k1 Installation fails with tiny-secp256k1 on node v10 for v10.9.0 and earlier Dec 18, 2018
@junderw
Copy link
Member

junderw commented Dec 18, 2018

I confirmed the problem persists for 8,7,6, and 5 minor versions of v10 as well.

@junderw junderw added the bug label Dec 18, 2018
@junderw junderw self-assigned this Dec 18, 2018
@kento1218
Copy link

It seems to be fixed in [email protected] nodejs/nan#833

@aminmazi
Copy link

aminmazi commented Jan 9, 2019

I can not install bitcoinjs-lib too,
environment:

node-gyp -v:
v3.8.0
node -v
v11.6.0

the error:

Error: Command failed: AppData\Local\Programs\Python\Python37-32\python.exe -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack     at ChildProcess.emit (events.js:188:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:978:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd \node_modules\tiny-secp256k1
gyp ERR! node -v v11.6.0
gyp ERR! node-gyp -v v3.8.0

npm ERR! [email protected] install: `node-gyp rebuild`

installing windows-build-tools didn't help.
does anyone know what should I do?

@kento1218
Copy link

@aminmazi That error is not related to this issue. You may be using python 3 but it’s not supported by node-gyp.

@aminmazi
Copy link

@kento1218 Thank you very much.
I had two versions of python installed, I just uninstalled the python3 and the problem has been solved now.

@johnta0
Copy link
Contributor

johnta0 commented Jan 17, 2019

It seems that this issue can be closed? @junderw

@junderw junderw closed this as completed Jan 17, 2019
@athergeek
Copy link

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

@dendisuhubdy
Copy link

Python2 seems to be unsupported soon. When are you going to move to Python3?

@junderw
Copy link
Member

junderw commented Jun 17, 2019

What do you mean "you"?

python 2 is used by node-gyp

we use node-gyp

If you'd like to make a version of node-gyp that uses python 3, let us know.

@GoodFaithParadigm8
Copy link

Had this same issue with node v12.18.3.

Installing node v10.14.2 corrected the problem.

@junderw
Copy link
Member

junderw commented Jun 1, 2021

Had this same issue with node v12.18.3.

Installing node v10.14.2 corrected the problem.

It installs properly for me:

$ node -v
v12.18.3
$ npm -v
6.14.11
$ npm install --no-progress --silent >/dev/null 2>&1 && echo SUCCESS
SUCCESS

@GoodFaithParadigm8
Copy link

$ npm install --no-progress --silent 2>&1 >/dev/null && echo SUCCESS
SUCCESS

No npm chatter? Unfortunately I closed all the terminal(s) that had my error messages. Windows 10 build 19041.985 . Both Windows and WSL2. As stated, installing v10.14.2 corrected the problem - on WSL2, specifically.

@junderw
Copy link
Member

junderw commented Jun 1, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants