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

Austin France edited comment on CB-14150 at 6/20/18 1:53 PM:
-------------------------------------------------------------

Some debugs from cordova-fetch index.js for the cordova plugin add 
../plugins/redsky-firebase (the fetch following installation of geolocation 
plugin)

tree 1: 
\{"cordova-android":"6.3.0","cordova-custom-config":"5.0.2","cordova-ios":"4.5.4","cordova-plugin-background-geolocation":"2.2.8","cordova-plugin-camera":"4.0.3","cordova-plugin-compat":"1.2.0","cordova-plugin-file":"6.0.1","cordova-plugin-network-information":"2.0.1","cordova-plugin-printer":"0.7.3","cordova-plugin-statusbar":"2.4.2","cordova-plugin-vibration":"3.1.0","cordova-plugin-whitelist":"1.3.3","redsky-background-fetch":"1.0.0","redsky-firebase":"1.0.7","redsky-utility":"1.0.8"}

tree 2: 
\{"cordova-android":"6.3.0","cordova-custom-config":"5.0.2","cordova-ios":"4.5.4","cordova-plugin-background-geolocation":"UNMET","cordova-plugin-camera":"4.0.3","cordova-plugin-compat":"1.2.0","cordova-plugin-file":"6.0.1","cordova-plugin-network-information":"2.0.1","cordova-plugin-printer":"0.7.3","cordova-plugin-statusbar":"2.4.2","cordova-plugin-vibration":"3.1.0","cordova-plugin-whitelist":"1.3.3","redsky-background-fetch":"1.0.0","redsky-firebase":"1.0.7","redsky-utility":"1.0.8"}

jsonDiff

obj1.cordova-android = 6.3.0
 obj2.cordova-android = 6.3.0
 obj1.cordova-custom-config = 5.0.2
 obj2.cordova-custom-config = 5.0.2
 obj1.cordova-ios = 4.5.4
 obj2.cordova-ios = 4.5.4
 obj1.cordova-plugin-background-geolocation = 2.2.8
 obj2.cordova-plugin-background-geolocation = UNMET
 result is cordova-plugin-background-geolocation
 obj1.cordova-plugin-camera = 4.0.3
 obj2.cordova-plugin-camera = 4.0.3
 obj1.cordova-plugin-compat = 1.2.0
 obj2.cordova-plugin-compat = 1.2.0
 obj1.cordova-plugin-file = 6.0.1
 obj2.cordova-plugin-file = 6.0.1
 obj1.cordova-plugin-network-information = 2.0.1
 obj2.cordova-plugin-network-information = 2.0.1
 obj1.cordova-plugin-printer = 0.7.3
 obj2.cordova-plugin-printer = 0.7.3
 obj1.cordova-plugin-statusbar = 2.4.2
 obj2.cordova-plugin-statusbar = 2.4.2
 obj1.cordova-plugin-vibration = 3.1.0
 obj2.cordova-plugin-vibration = 3.1.0
 obj1.cordova-plugin-whitelist = 1.3.3
 obj2.cordova-plugin-whitelist = 1.3.3
 obj1.redsky-background-fetch = 1.0.0
 obj2.redsky-background-fetch = 1.0.0
 obj1.redsky-firebase = 1.0.7
 obj2.redsky-firebase = 1.0.7
 obj1.redsky-utility = 1.0.8
 obj2.redsky-utility = 1.0.8
 json diff cordova-plugin-background-geolocation

getPath: args
 id cordova-plugin-background-geolocation 
 dest /Users/adf/.../RMCv2/node_modules 
 target /Users/adf/.../plugins/redsky-firebase

getPath returns: 
 /Users/adf/.../RMCv2/node_modules/cordova-plugin-background-geolocation

Error: Failed to get absolute path to installed module

I did wonder about the UNMET handling, as the code has an re of /UNMET PEER 
DEPENDENCY/ which it tests the key of tree 1 against, but this has UNMET as 
obj2[key] don't know if thats significant or not.

If I change the following line in index.js:getJsonDiff()

 
{code:java}
if (obj2[key] !== obj1[key]) {
{code}
to
{code:java}
if (obj2[key] !== obj1[key] && obj2[key] !== 'UNMET') {{code}
The second plugin installs, as getJsonDiff returns nothing so trimID is called 
instead.

(ofc I have no idea if thats a sensible change as I have no idea what that 
logic is doing)  


was (Author: mehuge):
Some debugs from cordova-fetch index.js for the cordova plugin add 
../plugins/redsky-firebase (the fetch following installation of geolocation 
plugin)

tree 1: 
\{"cordova-android":"6.3.0","cordova-custom-config":"5.0.2","cordova-ios":"4.5.4","cordova-plugin-background-geolocation":"2.2.8","cordova-plugin-camera":"4.0.3","cordova-plugin-compat":"1.2.0","cordova-plugin-file":"6.0.1","cordova-plugin-network-information":"2.0.1","cordova-plugin-printer":"0.7.3","cordova-plugin-statusbar":"2.4.2","cordova-plugin-vibration":"3.1.0","cordova-plugin-whitelist":"1.3.3","redsky-background-fetch":"1.0.0","redsky-firebase":"1.0.7","redsky-utility":"1.0.8"}

tree 2: 
\{"cordova-android":"6.3.0","cordova-custom-config":"5.0.2","cordova-ios":"4.5.4","cordova-plugin-background-geolocation":"UNMET","cordova-plugin-camera":"4.0.3","cordova-plugin-compat":"1.2.0","cordova-plugin-file":"6.0.1","cordova-plugin-network-information":"2.0.1","cordova-plugin-printer":"0.7.3","cordova-plugin-statusbar":"2.4.2","cordova-plugin-vibration":"3.1.0","cordova-plugin-whitelist":"1.3.3","redsky-background-fetch":"1.0.0","redsky-firebase":"1.0.7","redsky-utility":"1.0.8"}

jsonDiff

obj1.cordova-android = 6.3.0
 obj2.cordova-android = 6.3.0
 obj1.cordova-custom-config = 5.0.2
 obj2.cordova-custom-config = 5.0.2
 obj1.cordova-ios = 4.5.4
 obj2.cordova-ios = 4.5.4
 obj1.cordova-plugin-background-geolocation = 2.2.8
 obj2.cordova-plugin-background-geolocation = UNMET
 result is cordova-plugin-background-geolocation
 obj1.cordova-plugin-camera = 4.0.3
 obj2.cordova-plugin-camera = 4.0.3
 obj1.cordova-plugin-compat = 1.2.0
 obj2.cordova-plugin-compat = 1.2.0
 obj1.cordova-plugin-file = 6.0.1
 obj2.cordova-plugin-file = 6.0.1
 obj1.cordova-plugin-network-information = 2.0.1
 obj2.cordova-plugin-network-information = 2.0.1
 obj1.cordova-plugin-printer = 0.7.3
 obj2.cordova-plugin-printer = 0.7.3
 obj1.cordova-plugin-statusbar = 2.4.2
 obj2.cordova-plugin-statusbar = 2.4.2
 obj1.cordova-plugin-vibration = 3.1.0
 obj2.cordova-plugin-vibration = 3.1.0
 obj1.cordova-plugin-whitelist = 1.3.3
 obj2.cordova-plugin-whitelist = 1.3.3
 obj1.redsky-background-fetch = 1.0.0
 obj2.redsky-background-fetch = 1.0.0
 obj1.redsky-firebase = 1.0.7
 obj2.redsky-firebase = 1.0.7
 obj1.redsky-utility = 1.0.8
 obj2.redsky-utility = 1.0.8
 json diff cordova-plugin-background-geolocation

getPath: args
 id cordova-plugin-background-geolocation 
 dest /Users/adf/.../RMCv2/node_modules 
 target /Users/adf/.../plugins/redsky-firebase

getPath returns: 
 /Users/adf/.../RMCv2/node_modules/cordova-plugin-background-geolocation

Error: Failed to get absolute path to installed module

I did wonder about the UNMET handling, as the code has an re of /UNMET PEER 
DEPENDENCY/ which it tests the key of tree 1 against, but this has UNMET as 
obj2[key] don't know if thats significant or not.

If I change the following line in index.js:getJsonDiff()

 
{code:java}
if (obj2[key] !== obj1[key]) {
{code}
to
{code:java}
if (obj2[key] !== obj1[key] && obj2[key] ) not found.== 'UNMET') {{code}
The second plugin installs, as getJsonDiff returns nothing so trimID is called 
instead.

(ofc I have no idea if thats a sensible change as I have no idea what that 
logic is doing)  

> 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