npm安装时产生ENOENT错误

时间:2013-07-06 16:24:10

标签: 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 ]

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

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

1 个答案:

答案 0 :(得分:2)

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

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

  2.   
  3. 将环境变量PYTHON设置为你的python.exe,在我的例子中我运行&#34;设置PYTHON = E:\ Python27 \ python.exe&#34;在运行npm之前

  4.