NPM包不是在Windows 8.1上构建的-失败,出现以下错误,
error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
我尝试过以下几种方法:
VCTargetsPath
设置为C:\Program Files (x86)\MSBuild\12.0\
(错误会相应更改,但2012 build tools).Microsoft.Cpp.Default.props
(卸载后按正确顺序安装),并尝试使用VisualStudio 2012。)它应该根据this answerNode-gyp
wikiVisualStudioVersion
,然后再根据this answer将--msvs_version=2012
传递给npm
上述方法都不起作用。
我已经在这上面花了很长时间了。有没有人有一个明确的答案是可行的?
发布于 2016-02-23 04:04:59
我只是想用最新的答案更新这个问题。您现在不需要安装Visual Studio。
来源:https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245
下面的说明以防信号源出现故障。
cmd安装Python 2.7,并将其添加到您的路径中:npm config set python python2.7
npm config set msvs_version 2015 --global
(这不是每次都运行lnpm install [package name] --msvs_version=2015l
。)https://stackoverflow.com/questions/21069699
复制相似问题