繁体   English   中英

无法在Windows 7中安装npm软件包PM2

[英]Not able to install npm package PM2 in windows 7

无法在Windows 7中安装npm软件包PM2,我们遇到以下错误

> usage@0.3.9 install C:\Users\evaith\AppData\Roaming\npm\node_modules\pm2\node_modules\usage
> node-gyp rebuild


C:\Users\evaith\AppData\Roaming\npm\node_modules\pm2\node_modules\usage>node "C:\Program Files\nodejs\node_modules\npm\b
in\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:118:
14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:81:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuil
d"
gyp ERR! cwd C:\Users\evaith\AppData\Roaming\npm\node_modules\pm2\node_modules\usage
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm http 304 https://registry.npmjs.org/keypress
npm ERR! not ok code 0
PS C:\Users\evaith>

为什么要寻找Python路径。

PM2使用需要编译的本机组件。 许多节点程序包都使用node-gyp( 参考 )来使跨平台构建本机C / C ++代码更加方便和可靠。

node-gyp gyp的依赖项之一是2.7.3+系列的Python(3.x不兼容)。 因此,为了编译尚未包含本机二进制文件或不支持JavaScript的软件包,您可能需要Python。 但是,如果您在Windows上进行编译,则还需要一个编译器。 我建议按照node-gyp网页上的说明进行操作(您需要安装Visual Studio的免费版本)。

但是,稍后您将遇到更严重的错误,即Windows不支持PM2( https://github.com/Unitech/pm2/issues/6?source=cc )。

错误:找不到Python可执行文件“ python”,您可以设置PYTHON env变量。

安装python吗? 在这里得到

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM