bnoordhuis / node-buffertools

working with node.js buffers made easy
ISC License
205 stars 35 forks source link

configure error when npm install buffertools #92

Closed AllenBootung closed 6 years ago

AllenBootung commented 6 years ago

I was installing caress-server https://github.com/ekryski/caress-server This need buffertools. When I npm install buffertools. It showed configure error and syntax error.

import sys; print "%s.%s.%s" % sys.version_info[:3]; Does this line have problem? I cant find the file named 「string」.

win7 x64 Visual Studio Community 2017 15.6.6 node v8.12.0 Microsoft Windows [version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

D:\xampp\htdocs\caress>npm install buffertools

buffertools@2.1.6 install D:\xampp\htdocs\caress\node_modules\buffertools node-gyp rebuild

D:\xampp\htdocs\caress\node_modules\buffertools>if not defined npm_config_node_gyp (node "C:\Users\HD-User\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\HD-User\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )

gyp ERR! configure error gyp ERR! stack Error: Command failed: D:\Program Files (x86)\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "<string>", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack             ^(it point to「"」) gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:276: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:915:16) gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:336: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:561:12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "D:\Program Files\nodejs\node.exe" "C:\Users\HD-User\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\xampp\htdocs\caress\node_modules\buffertools gyp ERR! node -v v8.12.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN caress-server@0.2.1 No license field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! buffertools@2.1.6 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the buffertools@2.1.6 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\HD-User\AppData\Roaming\npm-cache_logs\2018-10-01T06_07_08_422Z-debug.log

↓2018-10-01T06_07_08_422Z-debug.log https://gist.github.com/AllenBootung/3e6be050844d0ae7de51720b62c0e8eb

bnoordhuis commented 6 years ago

node-gyp, the build tool for node.js add-ons, needs python 2, not python 3. You can pass the path to python 2 with npm install --python <path> buffertools or set it in your .npmrc.

Let me know if you still have questions.

AllenBootung commented 6 years ago

Need npm install --global --production windows-build-tools