$ cd /home/Lu/

Keep-learning Lu

06 May 2020

405 Method Not Allowed by npm install

2020-05-06-11-57-54.png

When I tried to execute:

npm install

I got a 405 error: 405 Method Not Allowed. Checking it by click the URL behind:

http://registry.npmjs.org/whatwg-fetch/jquery

2020-05-06-13-37-40.png

Hmm, it's obviously a broken URL. So we need to tell npm which URL is correct, by adding it into .npmrc. Normally, it's already there directly in your repository directory:

2020-05-06-12-14-46.png

If it doesn't exist, just create one:

2020-05-06-13-42-12.png

strict-ssl=false
registry=http://registry.npmjs.org

As for the correct registry url, since http://registry.npmjs.org/whatwg-fetch/jquery not working, I tried

http://registry.npmjs.org/jquery :

2020-05-06-13-45-21.png

Volià! GET it!

Now we can npm install.

comments powered by Disqus