Austin France created CB-14150:
----------------------------------

             Summary: 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


[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 at least in my 
isolated tests, not yet amended my build scripts

_$ 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