使用npm安装角度时出错

时间:2014-09-29 23:16:14

标签: angularjs npm

如何在Windows 8.1 64bit上使用npm安装角度?

我已安装:

  • node v.0.10.32
  • npm v.1.4.28
  • Python v2.7.8
  • Microsoft Visual Studio Express 2012 for Windows 8
  • Microsoft Visual C ++ 2012

如果我在 VS2012的开发人员命令提示符中运行 npm install angular ,我会收到此错误:

c:\.....\.node-gyp\0.10.32\deps\uv\include\uv-private/uv-win.h(
32): fatal error C1083: Cannot open include file: 'winsock2.h': No such file or
 directory [c:\.......\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\validation.vcxproj]

gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\.....\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "D:\\robocat\\tools\\nodejs\\node_modules\\npm\\node_mod
ules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\....\node_modules\an
gular\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! contextify@0.1.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.9 install script.
npm ERR! This is most likely a problem with the contextify 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 contextify
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "D:\\.....\\nodejs\\\\node.exe" "D:\\robocat\\tools\\n
odejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "angular"
npm ERR! cwd c:\
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

但是,如果我在 CMD 中运行,我会收到此错误:

c:\Users\....\node_modules\angular\node_m
odules\jsdom\node_modules\contextify\build\contextify.vcxproj(18,3): error MSB4
019: The imported project "c:\Microsoft.Cpp.Default.props" was not found. Confi
rm that the path in the <Import> declaration is correct, and that the file exis
ts on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\robocat\tools\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "D:\......\\nodejs\\node_modules\\npm\\node_mod
ules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\......\node_modules\an
gular\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! contextify@0.1.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.9 install script.
npm ERR! This is most likely a problem with the contextify 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 contextify
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "D:\\......\\nodejs\\\\node.exe" "D:\\robocat\\tools\\n
odejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "angular" "--save"
npm ERR! cwd c:\angular-playground
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

0 个答案:

没有答案