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

Austin France commented on CB-14150:
------------------------------------

Ok, it does't just affect plugins it affects anything that it fetched.

I changed my build script sequence to avoid the above issue but it just crops 
up later.  So instead of doing

$ cordova plugin add 
[https://github.com/redskyit/cordova-plugin-background-geolocation.git]
$ cordova plugin add ../plugins/redsky-firebase
$ cordova platform add android

I now do

$ cordova plugin add ../plugins/redsky-firebase
$ cordova plugin add 
[https://github.com/redskyit/cordova-plugin-background-geolocation.git]
$ cordova platform add android

But now, the platform add fails to fetch android, because, you guessed it.



$ cordova --verbose platform add --save android
No scripts found for hook "before_platform_add".
No version supplied. Retrieving version from config.xml...
Grabbing pinned version.
Using cordova-fetch for cordova-android@~6.3.0
saving exact
Running command: npm install cordova-android@~6.3.0 --production --save-exact
Command finished with error code 0: npm 
install,cordova-android@~6.3.0,--production,--save-exact
_*getPath: 
/Users/adf/Sites/RMC2/trunk/Cordova/RMCv2/node_modules/cordova-plugin-background-geolocation
*_Error: Failed to fetch platform cordova-android@~6.3.0

> Error: CordovaError: Failed to get absolute path to installed module
> --------------------------------------------------------------------
>
>                 Key: CB-14150
>                 URL: https://issues.apache.org/jira/browse/CB-14150
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-fetch
>    Affects Versions: [email protected]
>            Reporter: Austin France
>            Priority: Blocker
>
> [email protected]
> I have the following situation when building my cordova project from clean.  
> By clean I mean
> rm -rf platforms plugins
> So I have my config.xml prepared (which I generate from a template) and I sit 
> in the project directory and I do
> _$ cordova plugin add 
> [https://github.com/redskyit/cordova-plugin-background-geolocation.git]_
>  _$ cordova plugin add ../plugins/redsky-firebase_
> (the real commands include variables, but for purposes of reproducing this 
> issue, they are not required)
> The second plugin add fails with: 
>  (where ... is /usr/local/lib/node_modules/cordova/node_modules)
> {code:java}
> Error: CordovaError: Failed to get absolute path to installed module
>      at Function.getPath (.../cordova-fetch/index.js:203:15)
>      at .../cordova-fetch/index.js:102:35
>      at _fulfilled (${NPM}/cordova-fetch/node_modules/q/q.js:854:54)
>      at self.promiseDispatch.done 
> (.../cordova-fetch/node_modules/q/q.js:883:30)
>      at Promise.promise.promiseDispatch 
> (.../cordova-fetch/node_modules/q/q.js:816:13)
>      at .../cordova-fetch/node_modules/q/q.js:624:44
>      at runSingle (.../cordova-fetch/node_modules/q/q.js:137:13)
>      at flush (.../cordova-fetch/node_modules/q/q.js:125:13)
>      at process._tickCallback (internal/process/next_tick.js:150:11) 
> {code}
> I added a console.log to getPath in cordova-fetch index.js and the output is 
> as follows:
> $ cordova plugin add 
> [https://github.com/redskyit/cordova-plugin-background-geolocation.git
>  getPath: 
> /Users/adf/.../RMCv2/node_modules/cordova-plugin-background-geolocation
>  _$ cordova plugin add ../plugins/redsky-firebase_
>  getPath: 
> /Users/adf/.../RMCv2/node_modules/cordova-plugin-background-geolocation
> Thats right, the second plugin add is using the first plugins path, and this 
> fails.
> Further more, if I run the second cordova plugin add command again, it then 
> works with getPath using the correct path this time.
> _$ cordova plugin add ../plugins/redsky-firebase_
>  getPath: /Users/adf/.../RMCv2/node_modules/redsky-firebase
> If I reverse the order in which I install plugins, it works ok
> _$ cordova plugin add ../plugins/redsky-firebase_
>  getPath: /Users/adf/.../RMCv2/node_modules/redsky-firebase
>  $ cordova plugin add 
> [https://github.com/redskyit/cordova-plugin-background-geolocation.git
>  getPath: 
> /Users/adf/.../RMCv2/node_modules/cordova-plugin-background-geolocation



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to