From 356102a451967d3b0990d62f99c4db298292a65c Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 16 Mar 2017 15:08:57 +0100 Subject: [PATCH] Fix 'wrong Python version' regex, clarify instructions, and add a testcase. --- src/analyze-error.js | 2 +- src/components/solution-viewer.tag | 2 +- testcases/2.txt | 48 ++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 testcases/2.txt diff --git a/src/analyze-error.js b/src/analyze-error.js index af41fff..125af79 100644 --- a/src/analyze-error.js +++ b/src/analyze-error.js @@ -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) { diff --git a/src/components/solution-viewer.tag b/src/components/solution-viewer.tag index bdd693f..c1bb142 100644 --- a/src/components/solution-viewer.tag +++ b/src/components/solution-viewer.tag @@ -29,7 +29,7 @@ solution-viewer h3 You have the wrong version of Python installed. p The node-gyp 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 setup instructions for node-gyp. - p If you're certain that you have Python 2 installed, you may need to configure npm 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 npm to know where it is. This is also covered in the above instructions. Specifically, you'll want to use the --version flag. solution(topic="gcc") h3 Your C++ compiler is too old. diff --git a/testcases/2.txt b/testcases/2.txt new file mode 100644 index 0000000..f124048 --- /dev/null +++ b/testcases/2.txt @@ -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. (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