问题
Of the several 405 related Questions posted here, none apply to my issue.
Here is the command I issued from Windows 7 on my Desktop PC:
npm install express
Here is the Error message:
npm ERR! code E405
npm ERR! 405 Method Not Allowed: express@latest
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mr9832\AppData\Roaming\npm-cache\_logs\2018-02-21T20_36_09_581Z-debug.log
Here is the verbose Error Log mentioned above
C:\Users\mr9832\AppData\Roaming\npm-cache_logs\2018-02-21T20_36_09_581Z-debug.log
How can I fix it?
回答1:
This answer is probably a little bit too late, but I had the same problem. I fixed it by putting following settings in the npm config (located in %USERDATA%/.npmrc):
strict-ssl=false
registry=http://registry.npmjs.org
It requests the packages over plain http instead of the secure https.
回答2:
I had the same problem, turns out the proxy and/or https-proxy config pointed to the wrong proxy server.
The following commands set the proxy to the correct address:
npm config set https-proxy http://127.0.0.1:3128
npm config set proxy http://127.0.0.1:3128
来源:https://stackoverflow.com/questions/48915738/npm-err-405-method-not-allowed-expresslatest