cordovavisual-studio-2013visual-studio-cordova

build fails with code 3


I created a new blank cordova app (using Multi-Device Hybrid Apps for Visual Studio 2013 CTP) and tried to build it with ripple for Android, Windows Phone 8 and also on my local machine for Win8. In all cases, the build starts, takes a couple of seconds (>10) and fails with:

The command ""C:\Users\myUser\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" build --platform "Windows-AnyCPU" --configuration "Debug" --projectDir . --projectName "TestCordovaApp1" "--AnyCPU"" exited with code 3.  

I checked the local path definitions as described for other questions with regards to error code 8 and the definition was okay. I did a reboot after the installation but still have the same result.

So the error seems to be platform independent. The source code was not adjusted. I only created the project and tried to run it.


Solution

  • Thanks to Priyank, I got the idea to change the log level of the build output to detail and found this:

        1>  npm http GET https://registry.npmjs.org/q
        1>  npm ERR! network getaddrinfo ENOTFOUND
        1>  npm ERR! network This is most likely not a problem with npm itself
        1>  npm ERR! network and is related to network connectivity.
        1>  npm ERR! network In most cases you are behind a proxy or have bad network settings.
        1>  npm ERR! network 
        1>  npm ERR! network If you are behind a proxy, please make sure that the
        1>  npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
    

    Then I defined my proxy at the shell using:

    npm config set proxy http://myproxy:8080
    npm config set https-proxy http://myproxy:8080
    

    After that, I cleaned the solution and started the build process. It could then successfully download the npm packages and the error was gone! It is important to set the http proxy AND https proxy (even if it delegates to http). Otherwise it will not build with another error 8.

    So after all, the company proxy was causing the issue.