npm安装时产生ENOENT错误

Tyl*_*son 5 windows install npm karma-runner

每次我尝试运行npm install时,我都会收到以下日志的ENOENT错误:

2563 error Error: spawn ENOENT
2563 error     at errnoException (child_process.js:980:11)
2563 error     at Process.ChildProcess._handle.onexit (child_process.js:771:34)
2564 error If you need help, you may report this log at:
2564 error     <http://github.com/isaacs/npm/issues>
2564 error or email it to:
2564 error     <npm-@googlegroups.com>
2565 error System Windows_NT 6.1.7601
2566 error command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program              Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phantomjs"
2567 error cwd C:\Users\Tyler
2568 error node -v v0.10.12
2569 error npm -v 1.2.32
2570 error syscall spawn
2571 error code ENOENT
2572 error errno ENOENT
2573 verbose exit [ 1, true ]
Run Code Online (Sandbox Code Playgroud)

我在这里粘贴了npm-debug.log中的完整日志:http://pastebin.com/8PB8JRzW

我正在运行Windows 7 64位,设置了我的PYTHON环境变量,安装了MSVS2012,安装了node-gyp,并以管理员身份运行命令行.有关如何让npm安装工作的任何想法?谢谢!

Tro*_*ggy 2

根据https://github.com/TooTallNate/node-gyp/issues/277#issuecomment-25943524

  1. 确保您的Python和节点都是x86(32位)或都是x86-x64(64位),混合会抛出此错误

  2. 将环境变量 PYTHON 设置为 python.exe,在我的例子中,我在运行 npm 之前运行了“set PYTHON=E:\Python27\python.exe”