Error when building AngularJSToDo hybrid app in Visual Studio - installation

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.

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,
Close Visual Studio
Open cmd
npm install -g [path to vs-mda example C:\Users\[user-name]\AppData\Roaming\npm\node_modules\vs-mda]
npm install -g [path to vs-mda-targets example C:\Users\[user-name]\AppData\Roaming\npm\node_modules\vs-mda-targets]
Open project and build

Related

Unable to launch DAML studio

On MacOs, when I try to launch daml studio from command line, I receive several errors and it doesn't launch.
I have gone through all the installation requirements for DAML including installing Visual Studio Code which runs successfully on my Mac as well as the latest Java SDK. I went through the quickstart and DAML successfully works on my system using the IOU on http://localhost:4000. I updated %PATH correctly and have gone through the instructions twice to make sure I'm not missing anything.
Here is what I launch and the results that it is providing...
MacBook-Pro-2:quickstart aron.elston$ daml studio
/bin/sh: code: command not found
Failed to install DAML Studio extension from marketplace.
Installing bundled DAML Studio extension instead.
/bin/sh: code: command not found
Failed to install DAML Studio extension from SDK bundle.
Please open an issue on GitHub with the above message.
https://github.com/digital-asset/daml/issues/new?template=bug_report.md
/bin/sh: code: command not found
Failed to launch DAML studio. Make sure Visual Studio Code is installed.
See https://code.visualstudio.com/Download for installation instructions.
MacBook-Pro-2:quickstart aron.elston$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/aron.elston/.daml/bin
MacBook-Pro-2:quickstart aron.elston$ pwd
/Users/aron.elston/.daml/bin/quickstart
MacBook-Pro-2:quickstart aron.elston$
I would expect it to open the project in Visual Studio Code but instead I get errors as shown above.
Looks like the code command to launch VS code isn't available on the command line. That should be fixable by following the instructions here: https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line

How to fix build error when running `react-native run-windows`?

After running react-native windows in a freshly initialized React Native app, if you immediately run react-native run-windows this error happens:
Build failed with message Error: Command failed: "C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe"
"C:/<path_to_project>/windows/<project_name>.sln" /clp:NoSummary;NoItemAndProperty;Verbosity=minimal /nologo
/p:Configuration=debug /p:Platform=x86
. Check your build configuration.
This can happen when you have installed Visual Studio, but never started it as "devenv.exe" before trying to use some commandline tools. There is some additional setup that happens on first launch of Visual Studio before the commandline tools can be invoked by the react-native run-windows command.
See the React Native Windows troubleshooting section for more information:
https://github.com/microsoft/react-native-windows/blob/0.60-stable/current/docs/SetupTroubleshooting.md

npm config set C compiler not to vcbuild.exe

When trying to npm install a node project in a Windows7 machine I am suffering from the inglorious error message:
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.
Because I am under Cygwin I have already installed gcc ($ gcc -v and $ g++ -v respond in both Cygwin and cmd).
How can I tell npm to use gcc to compile instead of the vcbuild.exe that I don't have installed?
Note: I have already tried node-gyp and it did not work.
Note2: I know for sure the code runs without problems in linux.
Here is what sorted out my problem and the steps that I took to reach the long-awaited solution:
Installed Visual Studio Community but the VCBuild.exe was not there still.
Installed Microsoft Build Tools 2015 and tried to install the affected module as: npm install bcrypt --msvs_version=2015 but I got the following error:
error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".
My last shot was to install Visual Studio Express for Desktop and after npm install bcrypt --msvs_version=2015 I manage to npm install and npm start my app in Windows7!!
Lastly I uninstalled Visual Studio Community and Microsoft Build Tools 2015.
Note I had to remove the bcrypt module from the dependencies in package.json and install it as npm install bcrypt --msvs_version=2015 inside my app folder.

Visual Studio Empty Cordova Multi Device Hybrid App Build Failure

After downloading and installing Multi-Device Hybrid Apps for Visual Studio CPT1, I created a TypeScript/Multi-Device Hybrid App project. I was able to build the project with Android and iOS targets, but when I switch the target platform to WP8, errors arose (this is all from VS):
1. MSBuild failed to create .xap when building cordova-wp8 for debugging.
2. X:\...\bld\Debug\platforms\wp8\cordova\build.bat: Command failed with exit code 2
3. The command ""X:\...\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" build --platform "Windows Phone" --configuration "Debug" --projectDir . --projectName "x" --buildServerUrl "" --buildTarget "PhoneEmulatorWvga512"" exited with code 8.
So I then decided to try this manually and got the following error:
X:\...\AppData\Roaming\npm\node_modules\vs-mda\node_modules\q\q.js:126
throw e;
^
Error: X:\...\bld\Debug\platforms\wp8\cordova\build.bat: Command failed with exit code 2
at ChildProcess.whenDone (X:\...\AppData\Roaming\npm\node_modules\vs-mda\node_modules\cordova\src\superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
This is all with a clean install and VS2013 Update 2.
I resolved the problem by clearing the registry key at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Platform
Noteworthy:
I do not believe the problem was specific to Cordova VS integration, but rather a problem with my environment setup playing nicely with Cordova.

Error when attempting to run new blank hybrid app

I currently get the following error when attempting to run a hybrid app using the new cordova ctp for Visual Studio 2013.
Error 11 The command
""C:\Users\Nick\AppData\Roaming\npm\node_modules\vs-mda\vs-cli"
prepare --platform Android --configuration Debug --projectDir .
--projectName "BlankCordovaApp2"" exited with code 1. C:\Users\Nick\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 115 5 BlankCordovaApp2
Do I need to install something else?
In certain cases, VS does not immediately detect the Android path after installation. Rebooting your machine is the only option for now.
for me I just deleted the bld folder and everything has become right

Resources