node-gyp 构建错误 windows x64 [英] node-gyp build error windows x64

查看:104
本文介绍了node-gyp 构建错误 windows x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我目前在 x64 操作系统上所做的:

Here's what I've done so far on my x64 OS:

  • 安装 Python (v2.7 -- 特别是 2.7.6) 并将其添加到系统路径 (C:\Python27)
  • 安装了 MS VS C++ 2010 Express 版本(我已经安装了 VS 2012 但没有 C++ 组件)
  • 为 Windows SDK 7.1 安装了编译器更新
  • 已成功执行 node-gyp configure(从我的 add-on 目录下的 nodejs\node_modules 下, binding.gyp 所在的位置)

  • Installed Python (v2.7 --specifically 2.7.6) and added it to the system path (C:\Python27)
  • Installed MS VS C++ 2010 Express Version (I already had VS 2012 but without the C++ component)
  • Installed the compiler update for Windows SDK 7.1
  • Successfully executed node-gyp configure (from my add-on directory under nodejs\node_modules where binding.gyp is located)

运行 node-gyp build(以管理员身份)** 这就是崩溃的原因,给我留下了:

ran node-gyp build (as administrator)** This is what crashed, leaving me with:

这个错误:

C:\Program Files\nodejs\node_modules\msnodesql>node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@0.12.2
gyp info using node@0.10.25 | win32 | x64
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the   "/m" switch.

链接:致命错误 LNK1181:无法打开输入文件 'kernel32.lib' [C:\Program Files\nodejs\node_modules\msnodesql\build\sqlserver.vcxproj]

gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\RNelson\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Users\\RNelson\\AppData\\Roaming\\npm\\node_modules\\node-      gyp\\bin\\node-gyp.js" "build"
gyp ERR! cwd C:\Program Files\nodejs\node_modules\msnodesql
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok

对正在发生的事情有什么想法吗?提前致谢!只是想将我的 node-sqlserver MS 驱动程序用于 Node.js

Any ideas as to what is going on? Thanks in advance! Just trying to use my node-sqlserver MS driver for Node.js

推荐答案

npm config set msvs_version 2013 --global 对我有用,因为我使用 VS 节点工具,你不需要每次都指定 msvs_version你做一个 npm 安装.

npm config set msvs_version 2013 --global worked for me as I use VS node tools and you dont need to specify msvs_version each time you do an npm install.

我遇到了一个问题,即 npm 的配置 (c:\Users\username\.npmrc) 有一个条目 msvs_version=2012 已过期.

I had an issue whereby npm's config (c:\Users\username\ .npmrc) has an entry msvs_version=2012 which was out of date.

这篇关于node-gyp 构建错误 windows x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆