DemocracyEarth / wallet

Censorship resistant democracies.
https://democracy.earth
MIT License
1.5k stars 286 forks source link

npm install fails: error when installing fibers #440

Closed Domiii closed 5 years ago

Domiii commented 5 years ago

Error log

When running npm install, I encounter:

fibers@1.0.15 install /Users/d/code/sovereign/node_modules/chimp/node_modules/fibers node build.js || nodejs build.js gyp ERR! configure error gyp ERR! stack Error: Command failed: /usr/local/opt/python/libexec/bin/python -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

My system

Mac OS 10.11.6 Node v8.15 and v8.11.1 (tried both) Node-gyp v3.8.0 and v3.6.2

Diagnosis

NOTE: I have followed the installation instructions, step by step.

  1. I tried the solution mentioned in #409 (downgrading to Node v8.11.1) and it did not help.
Domiii commented 5 years ago

Looking at the error in detail, it is clear that this version of fibers (or, I suppose, node-gyp, in general) requires Python v2. while my system default is Python v3..

Downgrading works!

As pointed out in nodejs/node-gyp#1337:

which python2.7
brew python2  # if you don't already have it
make sure its in your path
which python2.7 # make sure, you have it
npm config set python python2.7  # tell NPM (node-gyp) to use python2.7