ramanujan
ramanujan copied to clipboard
Solution/update docs: node-gyp dependency on Python 2.x
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;
[email protected] 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 [email protected] /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! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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
Thank you.