Fix 'wrong Python version' regex, clarify instructions, and add a testcase.

master
Sven Slootweg 7 years ago
parent f29e14e841
commit 356102a451

@ -20,7 +20,7 @@ function isMissingPython(code) {
}
function isWrongPython(code) {
return /Python executable "[^"]*" is v[^,]+, which is not supported by gyp./.test(code);
return /Python executable "[^"]*" is v[^,]+, which is not supported by gyp\./.test(code);
}
function isBindingSyntaxError(code) {

@ -29,7 +29,7 @@ solution-viewer
h3 You have the wrong version of Python installed.
p The <code>node-gyp</code> utility, which is used for installing compiled (C++) modules with NPM, only supports Python 2. However, you only seem to have Python 3 installed.
p To solve this problem, follow the <a href="https://github.com/nodejs/node-gyp#installation">setup instructions for <code>node-gyp</code></a>.
p If you're certain that you have Python 2 installed, you may need to configure <code>npm</code> to know where it is. This is also covered in the above instructions.
p If you're certain that you have Python 2 installed, you may need to configure <code>npm</code> to know where it is. This is also covered in the above instructions. Specifically, you'll want to use the <code>--version</code> flag.
solution(topic="gcc")
h3 Your C++ compiler is too old.

@ -0,0 +1,48 @@
> bcrypt@0.8.7 install /Users/xxxxxx/Documents/Github/Personal/Magnet/Apps/AccountsAPI/node_modules/bcrypt
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/Users/xxxxxx/.pyenv/shims/python" is v3.5.2, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:14)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:395:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:197:7)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
gyp ERR! stack at Socket.<anonymous> (internal/child_process.js:334:11)
gyp ERR! stack at emitOne (events.js:96:13)
gyp ERR! stack at Socket.emit (events.js:188:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:493:12)
gyp ERR! System Darwin 16.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/xxxxxx/Documents/Github/Personal/Magnet/Apps/AccountsAPI/node_modules/bcrypt
gyp ERR! node -v v6.6.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN eslint-config-google@0.7.1 requires a peer of eslint@>=3.8.1 but none was installed.
npm WARN magnet@1.0.0 No description
npm WARN magnet@1.0.0 No repository field.
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save"
npm ERR! node v6.6.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! bcrypt@0.8.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.8.7 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 bcrypt 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 bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/xxxxxx/Documents/Github/Personal/Magnet/Apps/AccountsAPI/npm-debug.log
Loading…
Cancel
Save