我正在尝试在 Windows 7 上为 Node.js 安装 johnny 5 库,但不断收到错误消息:
Your environment has been set up for using Node.js 0.10.15 (x64) and npm.
C:\Users\User>npm install johnny-five
npm http GET https://registry.npmjs.org/johnny-five
npm http 304 https://registry.npmjs.org/johnny-five
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/firmata
npm http GET https://registry.npmjs.org/es6-collections
npm http GET https://registry.npmjs.org/descriptor
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/compulsive
npm http GET https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/temporal
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/firmata
npm http 304 https://registry.npmjs.org/es6-collections
npm http 304 https://registry.npmjs.org/descriptor
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/compulsive
npm http 304 https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/temporal
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/socket.io-client/0.9.16
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/bindings/1.1.0
npm http GET https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/sf/0.1.6
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.16
npm http GET https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.
16.tgz
npm http 304 https://registry.npmjs.org/bindings/1.1.0
npm http 304 https://registry.npmjs.org/async/0.1.18
npm http 304 https://registry.npmjs.org/sf/0.1.6
> serialport@1.1.3 install C:\Users\User\node_modules\johnny-five\node_modules
\serialport
> node-gyp rebuild
C:\Users\User\node_modules\johnny-five\node_modules\serialport>node "C:\Progra
m Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bi
n\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Command failed: ImportError: No module named site
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:637:15)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at maybeClose (child_process.js:735:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:802:
5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\User\node_modules\johnny-five\node_modules\serialport
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm http 200 https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.
16.tgz
npm ERR! not ok code 0
我在mac上遇到了同样的问题,但是按照上一篇文章的建议通过安装xcode命令行组件解决了这个问题,但不知道如何在windows上解决这个问题。
谢谢你的帮助!