当我使用npm install安装node_modules时,我遇到了这个错误。
D:\react\...\node_modules\gulp-sass\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: 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 exists on disk.我已经安装了Visual Studio构建工具。
MSBuild位置为c:\Program File (x86)\MSBuild
我在路径Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0的regedit上将VCTargetsPath设置为$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\14.0@VCTargetsPath)
但是我不确定为什么要走D:\Microsoft.Cpp.Default.props的道路
我该如何解决这个问题?
发布于 2021-06-01 20:53:10
您必须检查该路径是否已在注册表中注册。Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\MSBuild\ToolsVersions\4.0
Name: VCTargetsPath
Type: REG_SZ
Value: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets如果对您无效,请将路径添加到系统环境路径。
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets希望能为你工作。
https://stackoverflow.com/questions/67783044
复制相似问题