【发布时间】:2018-09-29 14:07:32
【问题描述】:
所以我正在尝试安装一个名为 better-sqlite-pool 的 Node 包,但是我遇到了一个似乎无法解决的错误。每当我运行 npm i better-sqlite-pool 时,都会收到以下错误:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.Cpp.Current.targets(64,5): error MSB4062: The "SetEnv"
task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.Build.CppT
asks.Common.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, Pu
blicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the
<UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contain
s a public class that implements Microsoft.Build.Framework.ITask. [D:\Files\ScrimsBot\node_modules\integer\build\intege
r.vcxproj]
我对此进行了广泛的研究,并且尝试了几乎所有建议的修复方法,但均未成功。
我收到的第一个错误通过添加 VCTargetsPath 环境变量并将其设置为 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4 来解决。 0\v140。我在执行此操作之前收到的错误如下:
The imported project "D:\Microsoft.
Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exist
s on disk.
我尝试的另一件事是使用 npm install -g --production windows-build-tools 命令安装构建工具,但这并没有什么不同。
值得注意的是,我安装了 Visual Studio 2017 Enterprise,并安装了 VC++ 2015.3 v14.00 (v140) 工具集 用于桌面组件。
【问题讨论】:
标签: node.js visual-studio msbuild