简体   繁体   English

安装npm软件包时出现NodeJS 5错误

[英]NodeJS 5 errors while installing npm packages

Since I installed node 5.0.0, I start getting errors while installing most of npm packages. 由于我安装了节点5.0.0,因此在安装大多数npm软件包时开始出现错误。 it never happened before when I had node 4.x. 在拥有节点4.x之前从未发生过。

after

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

basically there's 2 main errors. 基本上有两个主要错误。

  • The first is asking for python. 首先是要求python。
  • The second is asking for .Net SDK 2.0. 第二个是要求.Net SDK 2.0。

after getting python 2.7.10 installed the first error disappeared. 安装python 2.7.10后,第一个错误消失了。 but I couldn't pass the MSbuild.exe error even after installing .Net SDK. 但是即使安装.Net SDK后,我也无法通过MSbuild.exe错误。

Is this happening with everyone? 这是每个人都发生的吗? Do I have to install Visual Studio to get node.js and NPM to work? 我是否必须安装Visual Studio才能使node.js和NPM正常工作?

I prefer not to. 我不想。 Any alternative way? 还有其他方法吗?

I tried a clean installation, restarted my PC and installed it again, same errors. 我尝试进行全新安装,然后重新启动计算机,然后再次安装,同样的错误。

Update 更新资料

Now I installed both Python and VS2015, the previous errors are gone but I have this error 现在我同时安装了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 should work. npm install --msvs_version=2013应该可以工作。

I am having problems with VS2015, too. 我也有VS2015的问题。

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

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