windows-7-x64 - node-gyp 构建错误 windows x64 : "fatal error LNK1181: cannot open input file ' kernel32. lib'"

标签 windows-7-x64 node-gyp node-sqlserver

这是我迄今为止在 x64 操作系统上所做的事情:

  • 安装了Python(v2.7——特别是2.7.6)并将其添加到系统路径(C:\Python27)

  • 已安装 MS VS C++ 2010 Express 版本(我已经安装了 VS 2012,但没有 C++ 组件)

  • 安装了 Windows SDK 7.1 的编译器更新

  • 成功执行node-gyp配置(来 self 的nodejs\node_modules下的附加目录,其中绑定(bind).gyp位于)

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

这个错误:

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.

LINK: fatal error 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

对正在发生的事情有什么想法吗?

最佳答案

我也遇到了类似的问题。我发现这个开关对我有帮助

--msvs_version=2012

例如

npm install --msvs_version=2012 <package>

关于windows-7-x64 - node-gyp 构建错误 windows x64 : "fatal error LNK1181: cannot open input file ' kernel32. lib'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21562038/

相关文章:

sql-server - npm 安装 node-sql 服务器在 Windows 7 上失败

javascript - 类型错误 : done is not a function query callback

ms-access - 通过链接到 Access 数据库的 ODBC 数据源进行缓慢的数据 Access

c++ - Node.js native 附加组件: where is node_api.位于何处?

Android Studio,Intel HAXM 找不到已启用但已在 BIOS 中启用的 VT-x

node.js - Npm install karma 在 node-gyp 重建时挂起

node.js - 从 WAF 迁移到 GYP - 包括库在内的问题

c++ - 在 Windows 7 x64 上检测 DVD-RAM 介质是否为空

windows - 无法安装 Atmel Studio 7