Deploying grunt-sass Results in Mangled Python Request #25636
Labels
addons
Issues and PRs related to native addons.
invalid
Issues and PRs that are invalid.
wrong repo
Issues that should be opened in another repository.
Hi all,
There appears to be a fundamental issue in the script when doing "npm install grunt-sass" which runs some Python (presumably) to test which version of Python version running under Windows (10). Please note: you can do this with other command-line switches without needing to feed Python via the command line (which will bring it's own bag of woes, leading to this problem!)
I've never used Python before, but I can see at a glance this is invalid. Firstly, "print" must be encapsulated with brackets (if you intend to output variable(s)). But second, this would never have worked anyway, since the command itself contains quotes (") for the print statement: the console will parse this first meaning you would have at least added outer-quotes to ensure these parse first (I'm 99% sure this will also be true of BASH/TSH/TCSH etc)
Below is the corrected command you will be able (successfully) to run as part of this script
"c:\some\path\python.exe -c import sys; print ("%s.%s.%s" %sys.version_info[:3]);"
This is true as of the latest Python version (at the time of writing = 3.7.2) https://www.python.org/downloads/
See output below for how this currently runs:
PS C:\Users\me\some\path> npm install grunt-sass
..
..
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\path\to\python\python.exe -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
gyp ERR! stack at ChildProcess.exithandler (child_process.js:275:12)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at Socket.emit (events.js:211:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:557:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\some\path\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Some\Path\Documents\Project\node_modules\node-sass
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
The text was updated successfully, but these errors were encountered: