user3398334
user3398334

Reputation: 21

Error While adding Cordova Platform add iOS

I am using Mac OS Sierra v10.12 and getting error while adding to my Phonegap project within the folder myApp:

$ node -v
v7.2.0

$ npm -v
3.10.9

$ cordova platform add ios

received following errors:

Error during untar for /Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package.tgz: Error: EACCES: permission denied, open '/Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package/package.json'
Error: Failed to fetch platform ios
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: EACCES: permission denied, open '/Users/{user_name}/.cordova/lib/npm_cache/cordova-ios/4.3.0/package/package.json'

Note: {user_name} is my mac user Id, Can anybody help me!

Upvotes: 2

Views: 3852

Answers (3)

scgy
scgy

Reputation: 181

Try upgrading npm, this worked for me:

npm install npm@latest -g

Upvotes: 2

Maybe this is a cache problem of cordova. Delete the cache and try to add the platform again:

rm -rf ~/.cordova

Upvotes: 2

Santosh Shinde
Santosh Shinde

Reputation: 6053

I think you have to issue with permission to add platform .

Try to following :

$sudo chown -R {user_name} /Users/{user_name}/.cordova/lib/npm_cache/

For more please check here.

Hopes this will help you !

Upvotes: 4

Related Questions