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

npm install #107

Open
thisisashukla opened this issue Jun 10, 2019 · 8 comments
Open

npm install #107

thisisashukla opened this issue Jun 10, 2019 · 8 comments

Comments

@thisisashukla
Copy link

Hi. I am trying to install the zerorpc-node on my system with Windows 10. Python 3.5 and Nodejs 10.16.0.
When i run npm install i get the following error

`npm install git+https://github.com/0rpc/zerorpc-node.git

zeromq@4.6.0 install path\node_modules\zeromq
node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)

prebuild-install WARN install No prebuilt binaries found (target=10.16.0 runtime=node arch=x64 platform=win32)

Downloading libzmq for Windows
Download finished

path\node_modules\zeromq>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: path\AppData\Local\Programs\Python\Python35\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "", 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:198:13)
gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd path\node_modules\zeromq
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zeromq@4.6.0 install: node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zeromq@4.6.0 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! path\AppData\Roaming\npm-cache_logs\2019-06-07T06_09_01_680Z-debug.log`

Is this repo not compatible with Python 3.5?
How is a node module dependent on Python?

@thisisashukla
Copy link
Author

Any help would be appreciated. Thanks

@TouiSoraHe
Copy link

I also encountered the same problem.

@daniel0076
Copy link

The package requires python2.x to do final setup, and it looks for python rather than python2, so just make sure your python goes to python2.x

@bruno-robert
Copy link

I'm also getting the same issue, tried alias python=python2 to no avail

@gabrielgrant
Copy link

@bruno-robert i think to work around this by using Python 2 you want to create a symlink (something like ln -s /usr/bin/python2 /usr/local/bin/python?), rather than an alias

That being said, it looks like newer versions of node-gyp have now added Python 3 support:
nodejs/node-gyp#1687 (comment)

Not 100% sure of the chain of events, but it seems like the zmq bindings are looking for a globally-installed version before falling back to their own version of gyp? So maybe try installing the latest node-gyp manually? (npm install -g node-gyp)

@bruno-robert
Copy link

bruno-robert commented Jun 20, 2020

It looks like it's using an old version of node-gyp that is bundled with npm.

Installing node-gyp globally only updates the global version, not npm's version.
$ node-gyp -v -> v7.0.0

but npm's node-gyp remains at an older version
/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js -v -> v5.1.0

Either updating npm's node-gyp or getting npm to use the global node-gyp would fix this I believe.

I haven't had time to try the symlink trick. I will give it a go at some point.

EDIT:

Tried updating npm's packaged node-gyp with:
npm explore npm -g -- npm install node-gyp@latest (instructions for *nix/windows here)

zerorpc installation is still failing even with node-gyp v7.0.0

@gabrielgrant
Copy link

@bruno-robert hmmm, what's the error now?

@bruno-robert
Copy link

Since I didn't have the logs on me, I just retried installing zerorpc in a fresh folder after restart. It seems to have successfully installed (with multiple warning: 'MakeCallback' is deprecated [-Wdeprecated-declarations] warnings).

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

No branches or pull requests

5 participants