ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Failed to fetch platform cordova-android@~6.2.2

Open jgw96 opened this issue 9 years ago • 52 comments

From @iamkhan001 on June 9, 2017 7:20

getting error while adding android platform

D:\Imran\ionic\notifications>ionic cordova platform add android

cordova platform add android --save ? Running command - failed!

[ERROR] Cordova encountered an error. You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova platform add android --save (exi t code 1):

    Using cordova-fetch for cordova-android@~6.2.2
    Error: Failed to fetch platform cordova-android@~6.2.2
    Probably this is either a connection problem, or platform spec is incorr

ect. Check your connection and platform name/version/URL. Error: cmd: Command failed with exit code ENOENT

Copied from original issue: ionic-team/ionic#11989

jgw96 avatar Jun 09 '17 14:06 jgw96

From @piotrowski on June 9, 2017 8:37

As the error message says:

Probably this is either a connection problem ... Check your connection

Are you behind a corporate proxy?

jgw96 avatar Jun 09 '17 14:06 jgw96

I'm getting something similar:

Error: Failed to fetch platform [email protected]
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 194 Error output:
npm ERR! path /Users/todd/code/expedition-app/node_modules/es6-promise-plugin/package.json
npm ERR! code ELOOP
npm ERR! errno -62
npm ERR! syscall open
npm ERR! ELOOP: too many symbolic links encountered, open '/Users/todd/code/expedition-app/node_modules/es6-promise-plugin/package.json'

The NPM log file:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/todd/.nvm/versions/node/v8.1.2/bin/node',
1 verbose cli   '/Users/todd/.nvm/versions/node/v8.1.2/bin/npm',
1 verbose cli   'install',
1 verbose cli   '[email protected]',
1 verbose cli   '--save' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session f287ac4f152a5ee4
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://registry.npmjs.org/cordova-android 19ms (from cache)
8 silly pacote version manifest for [email protected] fetched in 63ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly fetchPackageMetaData error for es6-promise-plugin@file:node_modules/es6-promise-plugin ELOOP: too many symbolic links encountered, open '/Users/todd/code/expedition-app/node_modules/es6-promise-plugin/package.json'
13 verbose stack Error: ELOOP: too many symbolic links encountered, open '/Users/todd/code/expedition-app/node_modules/es6-promise-plugin/package.json'
14 verbose cwd /Users/todd/code/expedition-app/node_modules
15 verbose Darwin 16.6.0
16 verbose argv "/Users/todd/.nvm/versions/node/v8.1.2/bin/node" "/Users/todd/.nvm/versions/node/v8.1.2/bin/npm" "install" "[email protected]" "--save"
17 verbose node v8.1.2
18 verbose npm  v5.0.3
19 error path /Users/todd/code/expedition-app/node_modules/es6-promise-plugin/package.json
20 error code ELOOP
21 error errno -62
22 error syscall open
23 error ELOOP: too many symbolic links encountered, open '/Users/todd/code/expedition-app/node_modules/es6-promise-plugin/package.json'
24 verbose exit [ -62, true ]

toddmedema avatar Jun 27 '17 22:06 toddmedema

Downgraded from Node 8 to Node 6 (as suggested here: https://github.com/katzer/cordova-plugin-local-notifications/issues/1329) and cordova was able to add android. Still ran into some difficulties with old plugins whose repos lacked package.json files, so had to hunt down forks of those plugins that're maintained / have a package.json file.

toddmedema avatar Jun 28 '17 00:06 toddmedema

@toddmedema Thank you for the information.

marcelodeandrade avatar Jun 28 '17 12:06 marcelodeandrade

Hi, What was the solution here?

@dwieeb @jgw96 What effect does the proxy have and how do you go around it?

pkitatta avatar Jul 17 '17 01:07 pkitatta

i have this error plz help me

hadijahangiri avatar Jul 23 '17 12:07 hadijahangiri

@hadijahangiri Try setting path = "C:\Windows\System32" in variable/system variable

madsongr avatar Aug 06 '17 21:08 madsongr

add this line in your environment varible in path C:\Windows\System32 its working now

satyanarayanapalli avatar Aug 16 '17 13:08 satyanarayanapalli

× Running command - failed! [ERROR] Exception: Using cordova-fetch for cordova-android@~6.2.2

musasesay avatar Aug 18 '17 20:08 musasesay

screen shot 2017-08-19 at 2 26 34 am

ghost avatar Aug 18 '17 21:08 ghost

screen shot 2017-08-19 at 2 29 31 am

ghost avatar Aug 18 '17 21:08 ghost

How to fix it ?

ghost avatar Aug 18 '17 21:08 ghost

@jumong you must open windows environment variables and add to path = "C:\Windows\System32" in system variables

madsongr avatar Aug 19 '17 00:08 madsongr

ok thanks

On Sat, Aug 19, 2017 at 8:51 AM, madsongr [email protected] wrote:

@jumong https://github.com/jumong you must open windows environment variables and add to path = "C:\Windows\System32" in system variables

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-cli/issues/2412#issuecomment-323489270, or mute the thread https://github.com/notifications/unsubscribe-auth/AYOO8OLPFKLXs5p-J-D9inHb5ickLAthks5sZjF9gaJpZM4N1a12 .

musasesay avatar Aug 19 '17 01:08 musasesay

@madsongr my os osX

ghost avatar Aug 19 '17 10:08 ghost

Am having the same issue now and adding "C:\Windows\System32" did not resolve my issue. Any help here would be great.

My Ionic Info command returns the below:

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : android 5.1.1
Ionic Framework    : ionic-angular 3.6.0

System:

Node : v6.11.0
npm  : 3.10.10
OS   : Windows 10

jln1989 avatar Aug 22 '17 06:08 jln1989

i have the same error.. I add C:\Windows\System32, but the same error

Daym3l avatar Aug 22 '17 13:08 Daym3l

@jln1989 @Daym3l did you try to open windows cmd again? Every change on system environment variables requires to close cmd and open it again.

madsongr avatar Aug 22 '17 18:08 madsongr

@jln1989 is it working now?

madsongr avatar Aug 23 '17 19:08 madsongr

@madsongr yes thank you

Daym3l avatar Aug 24 '17 13:08 Daym3l