簡體   English   中英

安裝npm軟件包時出現NodeJS 5錯誤

[英]NodeJS 5 errors while installing npm packages

由於我安裝了節點5.0.0,因此在安裝大多數npm軟件包時開始出現錯誤。 在擁有節點4.x之前從未發生過。

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program Files\Python27\python.exe", 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:116:14)
gyp ERR! stack     at c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Murhaf\AppData\Roaming\npm\node_modules\ember-cli\node_modules\bufferutil
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10240

基本上有兩個主要錯誤。

  • 首先是要求python。
  • 第二個是要求.Net SDK 2.0。

安裝python 2.7.10后,第一個錯誤消失了。 但是即使安裝.Net SDK后,我也無法通過MSbuild.exe錯誤。

這是每個人都發生的嗎? 我是否必須安裝Visual Studio才能使node.js和NPM正常工作?

我不想。 還有其他方法嗎?

我嘗試進行全新安裝,然后重新啟動計算機,然后再次安裝,同樣的錯誤。

更新資料

現在我同時安裝了Python和VS2015,以前的錯誤已消失,但我有此錯誤

 c:\\Users\\Murhaf\\Desktop\\sage\\node_modules\\bufferutil\\build\\bufferutil.vcxproj(20,3): error MSB4019: The imported projec t "C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V110\\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. gyp ERR! build error gyp ERR! stack Error: `msbuild` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Windows_NT 10.0.10240 gyp ERR! command "c:\\\\Program Files\\\\nodejs\\\\node.exe" "c:\\\\Program Files\\\\nodejs\\\\node_modules\\\\npm\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js" "rebuild" gyp ERR! cwd c:\\Users\\Murhaf\\Desktop\\sage\\node_modules\\bufferutil gyp ERR! node -v v5.0.0 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok npm WARN install:bufferutil bufferutil@1.2.1 install: `node-gyp rebuild` npm WARN install:bufferutil Exit status 1 

您需要Visual Studio和Python在Windows上安裝帶有二進制組件的模塊,這可能意味着您要安裝的模塊具有二進制組件,因此請嘗試在Visual Studio和Python之后安裝它。

npm install --msvs_version=2013應該可以工作。

我也有VS2015的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM