0

我正在尝试hiredis在 Windows 64 位系统上安装,因为node-celery软件包需要它。

系统正在运行

  • 节点 v7.9.0
  • npm v4.5.0
  • 带有更新 5 的 Visual Studio 社区 2013 ( en_visual_studio_community_2013_with_update_5_x86_6816332)
  • Windows 10(64 位)

跑步

npm config set msvs_version 2013
npm install --save hiredis

给出以下构建错误。

如何安装v120 build tools错误消息中的说明?

C:\Users\y\Dropbox\Code\test\backend\node_modules\hiredis>if not defined npm_config_node_gyp (node "C:\Users\y\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\
..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" 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\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v120 (Platform Toolset = 'v120') cannot be found. To build
using the v120 build tools, please install v120 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution,
and then selecting "Retarget solution". [C:\Users\y\Dropbox\Code\test\backend\node_modules\hiredis\build\deps\hiredis-c.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\y\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:285:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\y\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\y\Dropbox\Code\test\backend\node_modules\hiredis
gyp ERR! node -v v7.9.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hiredis@0.5.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hiredis@0.5.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hiredis 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 information on how to open an issue for this project with:
npm ERR!     npm bugs hiredis
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls hiredis
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\y\AppData\Roaming\npm-cache\_logs\2017-05-01T00_33_25_808Z-debug.log
4

1 回答 1

0

重新启动 Windows 解决了这个问题。

于 2017-05-01T00:58:26.707 回答