【问题标题】:‘node-gyp rebuild’ installation error when adding a package to meteor app in Windows 7在 Windows 7 中将包添加到流星应用程序时出现“node-gyp rebuild”安装错误
【发布时间】:2015-07-25 03:03:09
【问题描述】:

我试图向我的 Meteor 应用程序添加一个包 (mizzao:turkserver),但我一直收到此错误:

mizzao:turkserver: updating npm dependencies -- request, libxmljs,
validator, querystring, async, deepmerge...  
gypnpm ERR! Windows_NT 6.1.7601  
npm ERR! argv  
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\\\node.exe"
"C:\\Users\\PC4all\\AppData\\Local\\.meteor\\packages\\meteor-tool\\1.1.3\\mt-os
.windows.x86_32\\dev_bundle\\bin\\node_modules\\npm\\bin\\npm-cli.js"  
"install" "libxmljs@0.8.1"  
npm ERR! node v0.10.36  
npm ERR! npm  v2.7.3  
npm ERR! code ELIFECYCLE  

npm ERR! libxmljs@0.8.1 install: `node-gyp rebuild`  
npm ERR! Exit status 7  
npm ERR!  
npm ERR! Failed at the libxmljs@0.8.1 install script 'node-gyp rebuild'.  
npm ERR! This is most likely a problem with the libxmljs package,  
npm ERR! not with npm itself.  
npm ERR! Tell the author that this fails on your system:  
npm ERR!     node-gyp rebuild  
npm ERR! You can get their info via:  
npm ERR!     npm owner ls libxmljs  
npm ERR! There is likely additional logging output above.  

=> Babel active on file extensions: es6.js, es6, jsx    
=> Errors while adding packages:

While building package mizzao:turkserver:  
error: couldn't install npm package  

我正在 Windows 7 机器上开发我的 Meteor 应用程序,根据我从论坛上的帖子中收集到的信息,错误似乎与该事实有关(npm 和 Windows 之间的交互 ​​- 我没有找到任何帖子在 Linux 机器上描述相同的问题)。

我已经尝试按照此处的建议安装最新的 Python 版本和 MS Visual Studio 2013:https://github.com/TooTallNate/node-gyp#installation,并按照此处的建议设置一些环境变量:https://github.com/atom/atom/issues/2754。但这些都没有帮助。

任何帮助将不胜感激!

【问题讨论】:

    标签: node.js windows meteor npm node-gyp


    【解决方案1】:

    正如我在this comment 中所描述的,这似乎是为 npm 设置错误的 Python 路径的问题,因为 Meteor 的 npm 分布没有正确连接它。大多数 Linux 发行版都带有 Python,但 Windows 没有,因此它与运行 Windows 相关。

    可以通过确保已安装 Python,然后运行以下命令来解决此问题:

    npm config set python C:\Python27\python.exe
    

    使用旧的libxmljs 是因为mizzao:turkserver 依赖于相对旧的node MTurk API,我想在某个时候放弃它,但在时刻。

    另见:

    【讨论】:

    • 我安装了 Python 2.7.6,PYTHONPATH 环境变量设置为 C:\Python27\python.exe,我已经尝试运行 npm config set python C:\Python27\python.exe,但我一直收到同样的错误。
    • 你帮了我很多。
    猜你喜欢
    • 2012-08-12
    • 2019-04-21
    • 2022-07-25
    • 2014-11-29
    • 2015-08-23
    • 2020-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多