Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
cordova@7.1.0
-
None
-
None
Description
cordova-fetch@1.2.0
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)
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)
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