Error: Failed to fetch platform andriod


#1

I arrived my work and the first thing I did was try to install an Ionic 3 app in my android device but I got an error. It is strange because the previous day it worked.

ionic cordova build andriod

Output:

alxkc (photo) FindMeMobile $ ionic cordova build andriod
> cordova platform add andriod --save
Using cordova-fetch for andriod

Error: Failed to fetch platform andriod
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 1 Error output:
npm ERR! code E404
npm ERR! 404 Not Found: andriod@latest

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/alxkc/.npm/_logs/2017-12-06T16_21_54_358Z-debug.log

[ERROR] Exception:
alxkc (photo) FindMeMobile $

Complete log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'andriod', '--save' ]
2 info using npm@5.5.1
3 info using node@v8.9.2
4 verbose npm-session f26bb88ad9328d2c
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 404 https://registry.npmjs.org/andriod 766ms
8 silly fetchPackageMetaData error for andriod@latest 404 Not Found: andriod@latest
9 verbose stack Error: 404 Not Found: andriod@latest
9 verbose stack     at fetch.then.res (/usr/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
9 verbose stack     at tryCatcher (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
9 verbose stack     at Promise._settlePromiseFromHandler (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
9 verbose stack     at Promise._settlePromise (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
9 verbose stack     at Promise._settlePromise0 (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
9 verbose stack     at Promise._settlePromises (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
9 verbose stack     at Async._drainQueue (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
9 verbose stack     at Async._drainQueues (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
9 verbose stack     at Immediate.Async.drainQueues (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
9 verbose stack     at runCallback (timers.js:789:20)
9 verbose stack     at tryOnImmediate (timers.js:751:5)
9 verbose stack     at processImmediate [as _immediateCallback] (timers.js:722:5)
10 verbose cwd /home/alxkc/Documents/ProjectsIonic/FindMeMobile/node_modules
11 verbose Linux 4.10.0-40-generic
12 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "andriod" "--save"
13 verbose node v8.9.2
14 verbose npm  v5.5.1
15 error code E404
16 error 404 Not Found: andriod@latest
17 verbose exit [ 1, true ]

I tried to understand that log, but it does not tell my nothing.

This is my ionic info:

cli packages: (/home/alxkc/Documents/ProjectsIonic/FindMeMobile/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.9.2
    npm               : 5.5.1
    OS                : Linux 4.10

Environment Variables:

    ANDROID_HOME : /home/alxkc/Android/Sdk

Misc:

    backend : legacy

#2

Typing mistake

andriod@latest

android not andriod :wink:


#3

Omg! This is a completely shame. I was using exactly the same command every time I tried it. I removed the platform, and added it again, and removed, and install again the newest version. But was that, I was typing wrong android lol. This is a teach for other people that have typos while programming.


#4

You just arrived at work, I think you just needed a coffee first :wink:

Glad it worked out