我有一个依赖于 d3
版本 3.5.3
并且依赖于 contextify
的项目。当它通过 node-gyp
运行时,它就会爆炸。通常,我可以通过指定 msvs_version=2015
来解决此问题,但这并没有奏效。因此,我执行了以下操作:
- 修改了我的 VS 2015 安装并安装了一切,然后包括
Common Tools for Visual C++
。 - 已执行
npm install -g windows-build-tools
。 - 已执行
npm config set msvs_version 2015
即使执行了这些步骤,我仍然会收到此错误:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(44,5):
error MSB8020: The builds tools for v140 (Platform T oolset = 'v140') cannot be found.
To build using the v140 build tools, either click the Project menu or right-click the solution,
and then select "Update VC++ Projects...". Install v140 to build using the v140 build tools.
对我来说有趣的部分是它试图在 v110
中找到这些工具;我只是不确定为什么。
最佳答案
我通过在 Visual Studio 开发人员命令提示符中执行 npm install
解决了这个问题。
关于c++ - node-gyp 和 contextify - 找不到 v140 的构建工具(平台工具集 = 'v140'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40934035/