0
votes

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
Could you please post Output messages from Visual Studio Output window?Ponmalar
Following is all output information:1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets(95,5): warning : 由于未为 TypeScript 编译器给定要编译的文件,因此该编译器将跳过编译。 1> F:\exercise\2014\HybirdProgramm\HelloWorldMVA\HelloWorldMVA>call "C:\Program Files (x86)\nodejs\"\nodevars.bat 1> Your environment has been set up for using Node.js 0.10.26 (ia32) and npm. 1> ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\bhhi0ak0.n12\packages\vs-mdaJack Liu
1> ------ Build Settings: 1> 1> C:\Users\Administrator\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:126 1> throw e;Jack Liu
1>EXEC : error : Cannot find module 'qs' 1> at Function.Module._resolveFilename (module.js:338:15) 1> at Function.Module._load (module.js:280:25) 1> at Module.require (module.js:364:17) 1> at require (module.js:380:17) 1> at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\node_modules\cordova-lib\node_modules\request\index.js:21:10) 1> at Module._compile (module.js:456:26) 1> at Object.Module._extensions..js (module.js:474:10)Jack Liu
1> at Module.load (module.js:356:32) 1> at Function.Module._load (module.js:312:12) 1> at Module.require (module.js:364:17) 1> at require (module.js:380:17)Jack Liu

1 Answers

1
votes

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