Mohamed Salah
Mohamed Salah

Reputation: 1502

Cordova: Error adding android platform

I tried to add android platform to my project but I got error:

~/learn/hello$ cordova platform add android
npm http GET https://registry.npmjs.org/cordova-android/4.0.0
npm http 401 https://registry.npmjs.org/cordova-android/4.0.0
Unable to fetch platform android: Error: unauthorized Name or password is incorrect.: cordova-android/4.0.0

I'm wondering why this is happening Cordova version 5.0.0, Phonegap version 5.0.0-0.27.1

Upvotes: 4

Views: 487

Answers (2)

Jenn Gee
Jenn Gee

Reputation: 1

Most likely you have credentials in your .npmrc file that you need for publishing and cordova is misinterpreting them to be used.

Fix for this has been submitted: https://issues.apache.org/jira/browse/CB-8956 and won't show up until 5.1+ (Or whatever version number they decide to pick)

But in the meantime while Cordova 5.0.0 is latest, you can do this:

$HOME={current directory} cordova platform add android

Upvotes: 0

Hazem Hagrass
Hazem Hagrass

Reputation: 9848

I think this issue because of .npmrc in your home directory, just remove it and everything should work

Upvotes: 8

Related Questions