Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I solve the NPM "418 I'm a teapot" error when trying to use npm install?

Tags:

node.js

npm

proxy

I've been trying to install Yeoman and Gulp on a server that has a corporate proxy using the following command:

npm install -g yo gulp

However when I run this comand (or any "npm install" command) I get hit with:

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

I'm pretty confident that this is an issue pertaining to the proxy but I can't figure out what exactly is causing it.

Some tests I've done:

  • I added the proxy to my npmrc file with login information for authentication and I believe it's entered properly. If I change any part of the username or password my error changes to an E407 (authentication failed).

  • I ran "npm config set strict-ssl false" and that seemed to not do anything.

  • I tried running different installs and I still just get "418 I'm a teapot package@latest".

like image 271
forev3r Avatar asked Jul 25 '18 17:07

forev3r


People also ask

How do I fix error 418?

Fixing it. The simplest fix for this is to just uncheck the 'Extra Web Security? ' option in the DreamHost control panel for this domain. You have to wait a few minutes for the change to happen, but after that, the page should start working.

Why npm install giving error?

The npm ERR! code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer.

What is npm error?

The error in NPM, 'error package install failed, see above', can occur when the user creates a new project in Angular using Node. js using VS code. This means that NPM is corrupted in your system, and must reinstall NPM.


Video Answer


3 Answers

So after a few more hours of digging through forums and blogs the solution was to change my registry from "http://registry.npmjs.org/" to "https://registry.npmjs.org/".

Apparently when on some proxies the registry will redirect to the address but add port 443 to the address if trying to connect without the https.

Hope this helps anyone else experiencing this issue!

like image 130
forev3r Avatar answered Oct 11 '22 15:10

forev3r


I also got this error in my project and the main reason is change in our proxy settings. So i would like to suggest to check your proxy settings ... few commands which i used to resolve this error...

npm set strict-ssl false 
npm config set registry https://registry.npmjs.org/

check= https://registry.npmjs.org/

like image 32
Sonali more Avatar answered Oct 11 '22 14:10

Sonali more


Thanks for answering now my npm not showing Err 418 i'm a teapot again.

You must update npm config like this :

npm set strict-ssl false 
npm config set registry https://registry.npmjs.org/

Try again install package using npm..

like image 5
iwan.webdeveloper Avatar answered Oct 11 '22 15:10

iwan.webdeveloper