当我运行ionic cordova build windows
时,它会抛出错误,如 -
> cordova build windows
ENV var MSBUILDDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
Building project: C:\Users\shail\Desktop\ionic-demo\ionic-4-windows\platforms\windows\CordovaApp.Windows10.jsproj
Configuration : debug
Platform : anycpu
Buildflags : /p:AppxBundle=Never
MSBuildTools : C:\Program Files (x86)\MSBuild\14.0\bin
buildProject spawn: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild [ 'C:\\Users\\shail\\Desktop\\ionic-demo\\ionic-4-windows\\platforms\\windows\\CordovaApp.Windows10.jsproj',
'/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
'/nologo', '/p:Configuration=debug', '/p:Platform=anycpu', '/p:AppxBundle=Never'] { stdio: 'inherit' } C:\Users\shail\Desktop\ionic-demo\ionic-4-windows\platforms\windows\CordovaApp.Windows10.jsproj(61,5): error MSB4019: The imported project "C:\Program Files(x86)\MSBuild\Microsoft\VisualStudio\v14.0\Microsoft.VisualStudio..Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild: Command failed with exit code 1
任何人都可以帮助解决这个问题。
离子-v是qazxsw poi cordova -v是qazxsw poi
安装平台cordova平台列表qazxsw poi
使用Visual Studio 2017 Enterprise
根据错误消息:msbuild工具的路径无效。
1.至于vs2017,你使用的msbuild应该是4.12.0
而不是9.0.0
。
2.此外,v14.0适用于vs2015而v15.0适用于vs2017,请将设置中的所有'v14.0'更改为'v15.0'并运行它。