在 MAC OSX 上使用 WP8 平台构建 Ionic 应用程序时出错

Error building Ionic app using WP8 platform on MAC OSX

很高兴我使用 "ionic build android" 构建的 Android .apk 文件在 Samsung Note phone.

上运行

我想尝试相同的应用程序,但在不同的硬件上,即我的诺基亚 Lumia Windows Phone 8.

于是我先加了平台wp8,还算顺利

$ ionic platform add wp8
Updated the hooks directory to have execute permissions
WARNING: Applications for platform wp8 can not be built on this OS - darwin.
Adding wp8 project...
Running command: /Users/user01/.cordova/lib/npm_cache/cordova-wp8/3.8.2/package/bin/create /Users/user01/repos/myTabs/platforms/wp8 com.ionicframework.mytabs754813 myTabs
Creating Cordova Windows Project:
  App Name  : myTabs
  Namespace : com.ionicframework.mytabs754813
  Path      : /Users/user01/repos/myTabs/platforms/wp8
Copying necessary files to /Users/user01/repos/myTabs/platforms/wp8
Updating project files
Running command: /Users/user01/repos/myTabs/hooks/after_prepare/010_add_platform_class.js /Users/user01/repos/myTabs
add to body class: platform-wp8
Installing "cordova-plugin-console" for wp8
Installing "cordova-plugin-device" for wp8
Installing "cordova-plugin-splashscreen" for wp8
Installing "cordova-plugin-statusbar" for wp8
Installing "cordova-plugin-whitelist" for wp8

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Installing "ionic-plugin-keyboard" for wp8
Saving platform to package.json file
A platform already exists - now updating the entry: android platform=android, version=undefined, locator=wp8

但是,当我 运行 "ionic build wp8".

时出现错误
$ ionic build wp8
Running command: /Users/user01/repos/myTabs/hooks/after_prepare/010_add_platform_class.js /Users/user01/repos/myTabs
add to body class: platform-wp8
Running command: /Users/user01/repos/myTabs/platforms/wp8/cordova/build
ERROR: MSBuild tools not found
ERROR building one of the platforms: Error: /Users/user01/repos/myTabs/platforms/wp8/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/user01/repos/myTabs/platforms/wp8/cordova/build: Command failed with exit code 2

仔细查看日志:

WARNING: Applications for platform wp8 can not be built on this OS - darwin.

只能在 Windows 上构建 wp8 应用程序。当然,您可以使用 Bootcamp、Parallels 或任何其他虚拟机。