Error when building AngularJSToDo hybrid app in Vi

2019-08-27 19:16发布

问题:

I have installed Multi-Device Hybrid Apps for Visual Studio 2013 - CTP2,and other development tools are properly set up. Now I get some errors when trying to build for Android, iPhone, and for Windows Phone. error 1: Cannot find module 'qs'
error 2: “"C:\Users\Administrator\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" prepare --platform Android --configuration Debug --projectDir . --projectName "AngularJSToDo" --language "zh-CN"” exited with code 8。 C:\Users\Administrator\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets

please help me with this problem.

回答1:

It seems something went wrong while installing Cordova and other dependencies. q module is a library for promise.

Run following npm commands from command prompt,

  1. Close Visual Studio
  2. Open cmd
  3. npm install -g [path to vs-mda example C:\Users\[user-name]\AppData\Roaming\npm\node_modules\vs-mda]

  4. npm install -g [path to vs-mda-targets example C:\Users\[user-name]\AppData\Roaming\npm\node_modules\vs-mda-targets]

  5. Open project and build