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

Solution/update docs: node-gyp dependency on Python 2.x #29

Open
lfurzewaddock opened this issue May 8, 2017 · 1 comment
Open

Solution/update docs: node-gyp dependency on Python 2.x #29

lfurzewaddock opened this issue May 8, 2017 · 1 comment

Comments

@lfurzewaddock
Copy link

lfurzewaddock commented May 8, 2017

The node module 'farmhash' requires node-gyp, which requires python 2.x

Only python 3.x is included in some current LTS distributions (eg. Ubuntu Server 16.04.2 LTS)

Check your environment...

$ python3 -V

...should return the version included in the distribution eg...

Python 3.5.2

However if...

$ python -V

...returns anything other than a version number such as;

The program 'python' can be found in the following packages:

  • python-minimal
  • python3
    Try: sudo apt install

...then...

$ sudo apt-get update
$ sudo apt-get install python

Check your environment again...

$ python -V

...should return...

Python 2.7.12

The steps above will avoid the following error during npm install;

$ sudo npm install

...generates the following error if python is not available;

farmhash@1.2.1 install /home/lfw/projects/dev/senecajs/ramanujan/node_modules/farmhash
node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:449:14)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:353:11
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:69:16)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:81:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:90:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Linux 4.4.0-77-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/lfw/projects/dev/senecajs/ramanujan/node_modules/farmhash
gyp ERR! node -v v6.10.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
ramanujan@0.0.1 /home/lfw/projects/dev/senecajs/ramanujan
└── (empty)

npm ERR! Linux 4.4.0-77-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! farmhash@1.2.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the farmhash@1.2.1 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the farmhash package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs farmhash
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls farmhash
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/lfw/projects/dev/senecajs/ramanujan/npm-debug.log
npm ERR! code 1

@leognmotta
Copy link

Thank you.

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

2 participants