npm-register returning 404 even though package is in official npm registry
jessebye opened this issue · 2 comments
We are encountering a problem with npm-register
2.5.2 where we try to install a new package that exists in the official npm registry, but npm-register logs a 404:
measure#request=2928ms method=GET user-agent="npm/3.10.10 node/v6.12.1 darwin x64" status=404 path=/promise-retry request_id=0.6060019690578522
and npm complains the package isn't in the registry:
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "promise-retry"
npm ERR! node v6.12.1
npm ERR! npm v3.10.10
npm ERR! code E404
npm ERR! 404 no such package available : promise-retry
npm ERR! 404
npm ERR! 404 'promise-retry' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/jbye/npm-debug.log
------------------------------------------------------------
Restarting npm-register
does not resolve the problem.
Looks like the same issue as Issue 96
Leaving this open until the issue gets fixed.
Applied their solution like this
vim /usr/lib/node_modules/npm-register/lib/npm.js
Change line 54 to pkg = JSON.parse(req.body)
restart npm-register
Found that I had a server still on version 2.2.0 and it had the JSON.parse
but 2.5.2` does not.