Full error log:
C:\Users\user\Development\Tutorials\cordova-tutorial\hello\platforms\windows\CordovaApp.Windows.jsproj(70,3): 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.
Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
While doing Create your first app tutorial from official Cordova website, when building the helloworld app, I got the error I've posted above.
I'm building cordova project from commandline and using Visual C++ 2015 Build Tools and Windows 10 SDK - but not Visual Studio with built-in tools. Why? Because part of my current project, is to prepare dev environment for building Windows 10 UAP apps with Cordova, without need to install Visual Studio.
Anybody here had same or similar problem with building Cordova windows projects without having Visual Studio with tools installed?
Why I need to do, to resolve this issue?
" Microsoft.VisualStudio.WJProject.Default.props cannot be found. error MSB4019
enter in the platform/windows/cordova/lib open the msbuildtools with the notepad and edit this part: it's simple, you will edit the "var versions = ['15.0', '14.0', '12.0', '4.0'];" with your versions your have.
for example will remove the 15 and 14 in the two functions var versions = ['12.0', '4.0'];
and remove the "|| versions[2] || versions[3]" in this line var msbuildTools = versions[0] || versions[1] || versions[2] || versions[3];
"
As far as I know the missing target files are installed together with the Visual Studio instead of the MSBuild Tools.
I created a blank win10 environment(test machine) and installed both MSBuild tools also the Windows 10 SDK, I encountered the issue you have, the
Microsoft.VisualStudio.WJProject.Default.props
cannot be found.Then I checked my original machine(have Visual Studio 2015 installed), the folder that contains the correct target files(C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\JavaScript) is created at the same date as Visual Studio installed.
So Visual Studio installed something that we did not install. I have tried to copy the MSBuild folder from my original machine to the test machine, the error MSB4019 has been resolved, but I got another error:
After search the Internet, the TargetPlatformVersion is related to the Windows SDK version, then I have changed the value to the windows SDK version in the project file, but this error is still persist.
Obviously, The easiest way to build your building Cordova windows projects is to install Visual Studio. If you want make it work without Visual Studio, it sometimes a lot of work to figure out. You'll need to install the right Windows / .NET Platform SDK. You can install multiple of these SDKs side by side. You might need to install further SDKs to get your application to compile. The downloads for these all assume that you also have Visual Studio installed, but many of their payloads can also be installed separately. It can become quite a hassle.
Hope this can help you.