8

I have a cordova project and I added windows platform but when I run the project I have this error:

MSBuild v4.0 is not supported, aborting.
Error: AppPackages doesn't exists
asv
  • 3,332
  • 7
  • 24
  • 47

2 Answers2

14

Try to set OS environment variable VSINSTALLDIR = C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\ which points to your Visual Studio folder with MSBuild directory.

Sergey
  • 218
  • 2
  • 8
  • Ok thank you, I tried, now I have this: PS D:\project\cordova\test-menu-navigator> cordova run windows Building project: D:\project\cordova\test-app\platforms\windows\CordovaApp.Windows.jsproj Configuration : debug Platform : anycpu Error: Windows SDK not found. Ensure that you have installed Windows 8.1 SDK along with Visual Studio or install Windows 8.1 SDK separately from https://dev.windows.com/en-us/downloads – asv Apr 16 '17 at 14:01
  • Use --arch buid parameter to specify target platform like this: cordova run windows --arch=x86 --verbose – Sergey Apr 17 '17 at 15:23
  • 2
    Thank you, I solved installing Build Tools for Visual Studio 2017 in visualstudio.com/downloads/ section "Other tools and frameworks", with environment variable VSINSTALLDIR = C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\ and with in config.xml file. – asv Apr 29 '17 at 22:52
3

You have of install Microsoft Build Tools:

https://www.visualstudio.com/downloads/

  • Navigate to Other Tools and Frameworks
  • Download Build Tools for Visual Studio 2017
  • After, set OS environment variable VSINSTALLDIR = C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\ which points to your Visual Studio folder with MSBuild directory
Diogo Machado
  • 396
  • 2
  • 11