cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John M. Wargo (JIRA)" <>
Subject [jira] [Commented] (CB-4322) CLI still not recognizing when sample www project is not available.
Date Wed, 24 Jul 2013 16:15:48 GMT


John M. Wargo commented on CB-4322:

A colleague did some research and came up with the following:

I see absolutely no evidence in the cordova package that the NPM proxy settings are looked
at whatsoever.  So in other words, running 'npm config set proxy or https-proxy' doesn't affect
the cordova command line tools at all.  They use their own code and don’t consult NPM config

Now, I see that there is a require you can run that allows you to gain access to the NPM config

So I have modified lazy_load.js to query NPM config and explicitly set proxy settings based
on that.

Here is my modified lazy_load.js (see attached for the full code)

    npm           = require('npm'),


  }, function() { npm.load(function() {
    var uri = URL.parse(url);
    if (uri.protocol && uri.protocol[1] != ':') { // second part of conditional is
for awesome windows support. fuuu windows
      var npmProxy;
      if (uri.protocol == 'https:') {
        npmProxy = npm.config.get('https-proxy');
      } else {
         npmProxy = npm.config.get('proxy');
      var requestOptions = {uri:url};
      if (npmProxy) {
        requestOptions.proxy = npmProxy;   // set the proxy explicitly …
      shell.mkdir('-p', download_dir);
      events.emit('log', 'Requesting ' + url + '...');
      var size = 0;
      request.get(requestOptions, function(err, req, body) { size = body.length; })

This way we get cordova to use the NPM proxy settings.
> CLI still not recognizing when sample www project is not available.
> -------------------------------------------------------------------
>                 Key: CB-4322
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 3.0.0
>            Reporter: John M. Wargo
>            Assignee: Filip Maj
> Still having problems with the CLI not recognizing that it doesn't have a HelloWorld
project to use.
> C:\Users\i833153\dev>cordova create test
> [TypeError: Cannot read property 'length' of undefined]
> C:\Users\i833153\dev>cordova -d create test
> Creating a new cordova project with name "HelloCordova" and id "io.cordova.hello
> cordova" at location "C:\Users\i833153\dev\test"
> Using stock cordova hello-world application.
> cordova library for "www" already exists. No need to download. Continuing.
> Copying stock Cordova www assets into "C:\Users\i833153\dev\test\www"
> Error: downloaded www assets in C:\Users\i833153\.cordova\lib\www\cordova\3.0.0\
> www does not contain index.html, or www subdir with index.html
>     at finalize (C:\Users\i833153\AppData\Roaming\npm\node_modules\cordova\src\c
> reate.js:114:27)
>     at C:\Users\i833153\AppData\Roaming\npm\node_modules\cordova\src\create.js:1
> 54:17
>     at C:\Users\i833153\AppData\Roaming\npm\node_modules\cordova\src\lazy_load.j
> s:47:31
>     at Object.module.exports.custom (C:\Users\i833153\AppData\Roaming\npm\node_m
> odules\cordova\src\lazy_load.js:57:34)
>     at Object.lazy_load [as cordova] (C:\Users\i833153\AppData\Roaming\npm\node_
> modules\cordova\src\lazy_load.js:42:24)
>     at Object.create (C:\Users\i833153\AppData\Roaming\npm\node_modules\cordova\
> src\create.js:148:19)
>     at Object.<anonymous> (C:\Users\i833153\AppData\Roaming\npm\node_modules\cor
> dova\bin\cordova:42:22)
>     at Module._compile (module.js:456:26)
>     at Object.Module._extensions..js (module.js:474:10)
>     at Module.load (module.js:356:32)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message