首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NPM安装在windows-7中失败

NPM安装在windows-7中失败
EN

Stack Overflow用户
提问于 2014-12-03 06:48:44
回答 2查看 1.6K关注 0票数 0

我做的NPM安装在windows-7和我不知道我为什么要得到这个错误。

代码语言:javascript
复制
 C:\xampp\htdocs\dev4\nodejs\node_modules\jsdom\node_modules\contextify>node "C:\
 Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules
\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.t
argets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform T
oolset = 'v100') cannot be found. To build using the v100 build tools, please i
nstall Visual Studio 2010 build tools.  Alternatively, you may upgrade to the c
urrent Visual Studio tools by selecting the Project menu or right-click the sol
ution, and then selecting "Upgrade Solution...". [C:\xampp\htdocs\dev4\nodejs\n
ode_modules\jsdom\node_modules\contextify\build\contextify.vcxproj]
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 (C:\Program Files (x86)\nodejs\node_mo
dules\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.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\nod
e_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xampp\htdocs\dev4\nodejs\node_modules\jsdom\node_modules\context
ify
gyp ERR! node -v v0.10.31
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.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\xampp\htdocs\dev4\nodejs
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\xampp\htdocs\dev4\nodejs\npm-debug.log
npm ERR! not ok code 0

我试着做单独的模块,但是这个模块没有安装,因为它在内部依赖于另一个必需的模块。

我做了很多谷歌,但没有得到任何解决方案。

任何建议都会对我有帮助。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-12-04 07:55:21

从发布的错误日志中,node无法找到Visual的副本,以便在构建过程中使用。

节点-gyp文档 for Windows中,您需要:

  • Python (v2.7.3推荐,不支持v3.x.x )
  • Windows /Vista/7:
    • C++ 2010 (快速版本运行良好)
    • 对于节点和本机模块的64位构建,还需要Windows 7 64位SDK
    • 如果安装失败,请尝试卸载您首先安装的任何C++ 2010 x64和x86可再发行版。
    • 如果您收到未安装64位编译器的错误,还可能需要WindowsSDK7.1的编译器更新。

  • Windows 7/8: C++ 2012/13 for Windows (快速版本运行良好)

请确保已安装或更好的副本,然后再试一次。

票数 2
EN

Stack Overflow用户

发布于 2017-01-25 02:35:41

节点-gyp文档 for Windows中,您可以选择:

选项1:使用微软的windows安装所有必需的工具和配置--使用npm安装的构建工具--全球--生产窗口--从提升的PowerShell或CMD.exe (以管理员身份运行)构建工具。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27265349

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档