簡體   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