这是我到目前为止在x64操作系统上所做的事情:
安装Python(v2.7 - 特别是2.7.6)并将其添加到系统路径(C:\ Python27)
已安装的MS VS C++ 2010 Express版本(我已经安装了VS 2012但没有C++组件)
安装了Windows SDK 7.1的编译器更新
成功执行了node-gyp configure(来自我在node.spp所在的nodejs \node_modules下的附加目录)
运行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.
链接:致命错误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
我遇到了类似的问题.我发现这个开关帮助了我
--msvs_version=2012
所以例如
npm install --msvs_version=2012 <package>
npm config set msvs_version 2013 --global
我使用VS节点工具时为我工作,每次进行npm安装时都不需要指定msvs_version.
我有一个问题,即npm的配置(c:\ Users\username\.npmrc)有一个过期的msvs_version = 2012条目.
如果以上都不起作用(我的情况 - Windows10 64bit)
删除C:\ Users\user_name\.node-gyp
删除%AppData%/ npm
删除%AppData%/ npm-cache
然后再次安装node-gyp
遵循node-gyp页面上的说明
我选择了选项1 npm install --global --production windows-build-tools
花了一段时间让这个工作(对我来说,接受的答案没有用,对我来说这只是一半的解决方案)我做了以下:
可悲的是,你必须有视觉工作室(我为DESKTOP安装了2013年快车版)
安装了python 2.7.3(你不必设置任何环境变量)
以管理员身份运行cmd并转到项目根目录(package.json文件在哪里)
第一次运行: npm config set python C:\Python27\python.exe
然后: npm install -msvs_version=2013
诀窍在于命令npm config set python ...path_to_python_exe...
,它将由npm提供给我需要python的依赖.我不知道为什么将python设置为env变量是不够的.
用于在Windows或任何其他操作系统中安装node-gyp
首先,您可能需要下载node-gyp
$ npm install -g node-gyp-install
然后安装
$ npm install -g node-gyp
您可能需要以root/administrartor的身份执行上述过程.