cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Bachmann (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-13503) Problems with using plugins from local file system
Date Fri, 03 Nov 2017 08:49:00 GMT

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

Marco Bachmann commented on CB-13503:
-------------------------------------

This problem exists already in version 7.0.1. This is a big bummer for us. The only thing
that helped for me was to create a script that re installs everything in proper order:

cordova plugin rm my-local-plugin
cordova platform remove android
rm -r -f ./node_modules/
rm -r -f ./plugins/
mkdir plugins
cordova platform add android
cordova plugin add ./my-local-plugin

> Problems with using plugins from local file system
> --------------------------------------------------
>
>                 Key: CB-13503
>                 URL: https://issues.apache.org/jira/browse/CB-13503
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: AllPlatforms, cordova-fetch
>    Affects Versions: cordova@7.1.0
>            Reporter: Mark Veenstra
>            Priority: Blocker
>
> I am struggling to get up and running with {{cordova@7.1.0}} sometime now. Maybe I am
doing something wrong here but I can't figure it out. It seems to me something is going wrong
with locally defined plugins that needs to be installed and the way it is saved into {{package.json}}.
> So to get upgraded I first installed the latest version {{npm install -g cordova@7.1.0}}.
Then I did a {{cordova prepare}}.
> This {{prepare}} failed, after [some digging and trying|https://github.com/dpa99c/cordova-diagnostic-plugin/issues/245]
it seemed that some locally plugins that needs to be installed into the project are interrupting
other plugins. So I needed to disable the {{cordova-fetch}}. I set this globally with {{cordova
config set fetch false}}.
> After this config change the {{codova prepare}} command went all fine. So I thought this
is it.
> But when I tried to let my project be build by my CI server it failed on installating
NPM packages.
> Because a {{npm install}} command will install the dependencies defined in {{package.json}}
it will install the cordova plugins also. But in the beginning my plugins are in there like
this:
> {code}
> {
>   "name": "myApp",
>   "version": "1.0.0",
>   "description": "myApp description",
>   "dependencies": {
>     "cordova-android": "6.3.0",
>     "cordova-browser": "5.0.1",
>     "cordova-ios": "4.5.2",
>     "cordova-plugin-myplugin": "resources/cordova-plugin-myplugin",
>     "cordova-plugin-myplugin-locker": "resources/cordova-plugin-myplugin-locker"
>   },
>   "devDependencies": {
>   },
>   "scripts": {
>   },
>   "cordova": {
>     "platforms": [
>       "browser",
>       "android",
>       "ios"
>     ],
>     "plugins": {
>       "cordova-plugin-myplugin": {},
>       "cordova-plugin-myplugin-locker": {}
>     }
>   }
> }
> {code}
> With above {{npm install}} fails and tries to get the dependecies from git, which is
incorrect. So I search the {{package.json}} definition and they say I should put {{file:}}
in front of it, like this:
> {code}
> {
>   "name": "myApp",
>   "version": "1.0.0",
>   "description": "myApp description",
>   "dependencies": {
>     "cordova-android": "6.3.0",
>     "cordova-browser": "5.0.1",
>     "cordova-ios": "4.5.2",
>     "cordova-plugin-myplugin": "file:resources/cordova-plugin-myplugin",
>     "cordova-plugin-myplugin-locker": "file:resources/cordova-plugin-myplugin-locker"
>   },
>   "devDependencies": {
>   },
>   "scripts": {
>   },
>   "cordova": {
>     "platforms": [
>       "browser",
>       "android",
>       "ios"
>     ],
>     "plugins": {
>       "cordova-plugin-myplugin": {},
>       "cordova-plugin-myplugin-locker": {}
>     }
>   }
> }
> {code}
> Now NPM finds the dependecies OK, but now when I do a {{cordova prepare}} again it throws
an error that the plugin can't be installed from {{file:resources/cordova-plugin-myplugin}}.
> So I get stuck into different needs for different tools. Any ideas?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message