加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows – 使用npm安装生成ENOENT错误

发布时间:2020-12-14 02:50:24 所属栏目:Windows 来源:网络整理
导读:每次我尝试运行npm install时,我都会收到以下日志的ENOENT错误: 2563 error Error: spawn ENOENT2563 error at errnoException (child_process.js:980:11)2563 error at Process.ChildProcess._handle.onexit (child_process.js:771:34)2564 error If you n
每次我尝试运行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 Filesnodejsnode.exe" "c:Program              Filesnodejsnode_modulesnpmbinnpm-cli.js" "install" "-g" "phantomjs"
2567 error cwd C:UsersTyler
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安装工作的任何想法?谢谢!

解决方法

按照 https://github.com/TooTallNate/node-gyp/issues/277#issuecomment-25943524:

  1. Make Sure Your Python and node are both x86 (32Bit) or both x86-x64 (64Bit),a mix will throw this error

  2. Set the environment variable PYTHON to your python.exe,in my case I ran “set PYTHON=E:Python27python.exe” before running npm

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读