[
https://issues.apache.org/jira/browse/CB-13507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16342997#comment-16342997
]
Warren Crossing commented on CB-13507:
--------------------------------------
>From what I read in the code the problem can be explained like this.
Cordova can't lookup the module name, because it couldn't work out where npm
installed the package, even after it checked the repository/url of the
package.json in each and every child of the node-modules directory for the
exact url that you supplied in the pluginspec on the cmdline.
Your options are to either use a url spec that matches the regexp in
is-url/index.js i.e https|http, and have that as the repository/url in the
package.json which can be difficult with forks - especially if you don't
control the forks.
Or let git clone the git repo, then double up and get cordova to install the
plugin from the local filesystem.
i.e.
git clone https://github.com/warrenc5/Mapbox.git
cordova plugin add -d ./Mapbox –noregistry
The problem with this is that it makes the build highly non portable in some
ways, maybe fetch needs to take a hint on the command line of the module name,
or this may be a change to pluginspec, but it took me ages to work out what was
actually failing.
Hope this helps others.
> git+https or git+ssh fails when trying to install
> -------------------------------------------------
>
> Key: CB-13507
> URL: https://issues.apache.org/jira/browse/CB-13507
> Project: Apache Cordova
> Issue Type: Bug
> Components: AllPlatforms
> Affects Versions: 7.0.2
> Environment: I am selecting 7.0.2 since it's the closest but I am
> running cordova 7.1.0
> OS: Mac OS X Sierra.
> Although I don't think it has anything to do with cordova-ios and
> cordova-android, my platform versions are:
> - android 6.3.0
> - ios 4.5.2
> Reporter: Pablo Caselas
> Priority: Major
> Fix For: 7.0.2
>
>
> I start with adding plugin dependencies with https://...... on package.json
> (no plugin references on config.xml) and no platforms or plugins installed
> then I run "cordova platform ios".
> It installs the plugins without any problem, but changes config.xml and
> package.json plugin references from https to git+https, and ssh to git+ssh.
> Failed to restore plugin "cordova-plugin-document-viewer" from config.xml.
> You might need to try adding it again. Error: Failed to fetch plugin
> git+https://github.com/kas84/cordova-plugin-document-viewer.git via registry
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]