0

I am developing a project using Phonegap/Cordova version 5.4.1.

I have already created a project named "UnishKuri". Now I want to add some plugins, for example: Camera, Splash Screens.

The command that I have used is as follows:

cordova plugin add cordova-plugin-camera 

but I am getting an error with the message

"Error: Failed to fetch plugin cordova-plugin-camera via registry.    
 Probably this is either a connection problem , or plugin spec is 
 incorrect. Check your connection and plugin name/version/URL". 
 Error: getaddrinfo EAI_AGAIN registry.npmjs.org:443. 

I do have proper internet connection. Please do help me out. Thanks a lot in advance.

Namrata Sen
  • 41
  • 1
  • 8

1 Answers1

0

It looks like its a error with the cordova version. Try downgrading your cordova version to 5.1.1 and try again, to see if this is the problem.

npm i cordova@5.1.1

Then try again to fetch the plugin

cordova plugin add cordova-plugin-camera

If this works, downgrade your cordova version, or use @matthijs solution:

cordova plugin add https://github.com/apache/cordova-plugin-camera.git
Víctor
  • 3,029
  • 3
  • 28
  • 43