Question

I am trying to create an app using apache cordova , i struggled to install it. Finally, when everything worked just fine, i tried to add a plugin with this command :

C:\hello>cordova plugin add org.apache.cordova.console

then this message appears :

Fetching plugin "org.apache.cordova.console" via plugin registry

After a while an Error has appeared :

Error: Failed to fetch package information for org.apache.cordova.console
at C:\Users\pc\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman
\src\registry\registry.js:32:20
at Request.cb [as _callback] (C:\Users\pc\AppData\Roaming\npm\node_modules\c
ordova\node_modules\plugman\src\registry\registry.js:251:9)
at self.callback (C:\Users\pc\AppData\Roaming\npm\node_modules\cordova\node_
modules\plugman\node_modules\request\index.js:148:22)
at Request.EventEmitter.emit (events.js:117:20)
at ClientRequest.self.clientErrorHandler (C:\Users\pc\AppData\Roaming\npm\no
de_modules\cordova\node_modules\plugman\node_modules\request\index.js:257:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:415:13)   
Was it helpful?

Solution

Another simple way is

  1. download the plugin as zip from git
  2. extract the zip to some path
  3. run cordova plugin add cordova-plugin-splashscreen-master ( replace 'cordova-plugin-splashscreen-master' with your folder name )

OTHER TIPS

Make sure that you have added atlest one platform inside the created cordova project. Then try downloading directly from github through Command line interface(make sure your are inside the project director).

Eg:For console plugin

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git

for other plugin github link is found in cordova documentation itself

http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html

If the installation still fails.It means the plugin is deprecated for the cordova version you are using.In that case try upgrading cordova and then create a new project and repeat the same.

To upgrade you can use the command

npm update -g cordova

Ill suggest you an another method.Its long but it might get the job done.

All plugins are available to download in github Example:

https://github.com/apache/cordova-plugin-splashscreen

Download the zip file.

All plugin will fall into the plugin directory and into the structure define in rm command present in documentaion

example plugins/org.apache.cordova.core.splashscreen/www

Manually create this structure and replace the downloaded www folder from github inside your plugins/org.apache.cordova.core.splashscreen/www

Manually add the feature in config.xml

<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.SplashScreen" />
</feature>

Refer documentation.

http://cordova.apache.org/docs/en/3.0.0/cordova_splashscreen_splashscreen.md.html#Splashscreen

Build the app.It will work

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top