[ 
https://issues.apache.org/jira/browse/CB-7670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14153154#comment-14153154
 ] 

Vladimir Kotikov commented on CB-7670:
--------------------------------------

Ploblem here is that cordova fetches platform and plugin using NPM and uses 
different registries for them.
Once npm is initialized using {{npm.load()}} in lazy_load module, further 
{{npm.load()}} (in plugman/fetch.js module) calls ignores provided 
configuration (https://github.com/npm/npm/blob/master/lib/npm.js#L263)

The proper way here is to load npm using  {{npm.load()}} and the nconfigure it 
using {{npm.config.set()}} as described here: 
https://github.com/npm/npm#using-npm-programmatically

> cordova fails to fetch dependent plugin while adding platform
> -------------------------------------------------------------
>
>                 Key: CB-7670
>                 URL: https://issues.apache.org/jira/browse/CB-7670
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib, Plugman
>            Reporter: Vladimir Kotikov
>
> *Repro steps*
> cordova create app1
> cd app1
> cordova plugin add org.apache.cordova.file-transfer
> cordova platform add windows
> *Expected*
> Platform and all dependent plugins installed successfully
> *Actual*
> I get an error:
> {noformat}
> Creating windows project...
> Creating Cordova Windows Project:
>         App Name  : HelloCordova
>         Namespace : io.cordova.hellocordova
>         Path      : d:\PROJECTS\Temp\test-file\platforms\windows
> Copying template to d:\PROJECTS\Temp\test-file\platforms\windows
> Installing "org.apache.cordova.file-transfer" for windows
> Fetching plugin "org.apache.cordova.file" via plugin registry
> npm http GET https://registry.npmjs.org/org.apache.cordova.file
> npm http 404 https://registry.npmjs.org/org.apache.cordova.file
> Failed to install 'org.apache.cordova.file-transfer':Error: 404 Not Found: 
> org.apache.cordova.file
>     at RegClient.<anonymous> 
> (d:\cordova\cordova-lib\cordova-lib\node_modules\npm\node_modules\npm-registry-client\lib\request.js:268:14)
>     at Request.self.callback 
> (d:\cordova\cordova-lib\cordova-lib\node_modules\npm\node_modules\request\index.js:148:22)
>     at Request.EventEmitter.emit (events.js:98:17)
>     at Request.<anonymous> 
> (d:\cordova\cordova-lib\cordova-lib\node_modules\npm\node_modules\request\index.js:876:14)
>     at Request.EventEmitter.emit (events.js:117:20)
>     at IncomingMessage.<anonymous> 
> (d:\cordova\cordova-lib\cordova-lib\node_modules\npm\node_modules\request\index.js:827:12)
>     at IncomingMessage.EventEmitter.emit (events.js:117:20)
>     at _stream_readable.js:919:16
>     at process._tickCallback (node.js:419:13)
> {noformat}
> The problem seems to be in fetching {{file}} as a dependent plugin.  It works 
> fine if file plugin is installed first.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to