npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

"npm update -g" will not throw an error if used on a non-existent package

What I Wanted to Do

I was trying to update a package & was mispelling the name (whoops). However, the cli call would go through without error, so I did not immediately realize nothing had happened.

What Happened Instead

Silent success. Using the --verbose option, I can see the cli returns [0, true] at the end.

Reproduction Steps

Try npm update -g not-an-existing-package-name

Expected output

npm i -g not-an-existing-package-name will instead print out

npm ERR! code E404
npm ERR! 404 Not Found - GET - Not found
npm ERR! 404
npm ERR! 404  'not-an-existing-package-name@latest' 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! A complete log of this run can be found in:
npm ERR!     C:\Users\Elliott\AppData\Roaming\npm-cache\_logs\2019-09-25T16_51_21_842Z-debug.log

Something similar would be nice.

Platform Info

$ npm --versions
{ npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  http_parser: '2.8.0',
  icu: '64.2',
  modules: '64',
  napi: '4',
  nghttp2: '1.39.2',
  node: '10.16.3',
  openssl: '1.1.1c',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.28.0',
  v8: '',
  zlib: '1.2.11' }
$ node -p process.platform