Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I tried to install ionic but it returns : npm ERR! code E418

I have a serious problem. I tried to install ionic, cordova, angular, react-native-cli, https-status-error and other packages and it always returns:

npm ERR! code E418
npm ERR! 418 I'm a teapot: ionic @ latest

Please note that it may be wrong and I do not understand what is happening. It was fine until 3 days ago.

like image 668
Rainer Gutierrez Argandoña Avatar asked May 28 '18 22:05

Rainer Gutierrez Argandoña


Video Answer


3 Answers

So, post may 29th '18, this is the common error being faced worldwide by devs working behind corporate proxies. The following tweak fixed the issue for me:

  1. Go to your .npmrc file.

    you'll have the following similar content in the file depending upon the configs you are setting up-

    strict-ssl=false
    registry=http://registry.npmjs.org/
    python=C:/Python27/python.exe
    msvs_version=2015
    http-proxy=<WHATEVER-PROXY-YOU-USUALLY-ADD>:8000
    

Note: Ignore the extra configs like python variable path.

  1. Update the registry link to 'https://registry.npmjs.org/'. So your file would look like this now-

     strict-ssl=false
     registry=https://registry.npmjs.org/
     python=C:/Python27/python.exe
     msvs_version=2015
     http-proxy=<WHATEVER-PROXY-YOU-USUALLY-ADD>:8000
    
  2. And Viola! you are all set to fire your npm install commands :)

like image 91
Siena Avatar answered Oct 16 '22 22:10

Siena


Work for me!

If you set proxy should be unset.

npm config delete proxy
npm config delete https-proxy

Solution resolve npm ^___^

npm cache clean --force
npm cache verify 
like image 29
bamossza Avatar answered Oct 16 '22 21:10

bamossza


I had the very same issue and managed to fix it. In my case, I initially had the value of "http://registry.npmjs.org/" and changed it to "https". Below are the set of commands I ran:

npm config set registry https://registry.npmjs.org/
npm cache clean --force
npm cache verify

npm install
like image 4
KPandian Avatar answered Oct 16 '22 21:10

KPandian