1

I am not sure that this happens (will happen) every time I install a new library, but at least I have seen this many times now after installing a library with npm:

Update available 5.6.0 → 5.8.0   
     Run npm i -g npm to update

I do that, of course, and the next time I install a library it happens again. I think I did not see that when I started using npm.

What could be going on here?

(I am on Windows 10 when doing this. After updating npm --version says 5.8.0. Next time I will check before...)

EDIT: Just checked with npm --version when I got the message to update. The version is 5.8.0, not 5.6.0. Quite strange.

Leo
  • 4,136
  • 6
  • 48
  • 72
  • 1
    Sounds like maybe the new npm path isn't sticking. Could be you need to update your path to point to the new one? – Catalyst Apr 11 '18 at 23:32
  • every time you give npm install (library), it automatically downloads the latest updated version I believe – Grijan Apr 12 '18 at 04:52
  • @Catalyst Yes, something like that. – Leo Apr 13 '18 at 10:18
  • @Grijan Do you mean that `npm` is updated when I install a library? – Leo Apr 13 '18 at 10:19
  • 1
    @Leo sorry dude, i forgot to update you, [link](https://stackoverflow.com/questions/12478679/npm-install-vs-update-whats-the-difference), if this is not clear, ping me here again , i will clarify you – Grijan Apr 13 '18 at 11:42
  • 1
    @Leo yes it will, and after installing if the package manager has released a new version, then you should update it(provided you have already installed the package), if you install(for the first time) after a new version of the package is updated, then u will get the latest version. hope this clarifies you – Grijan Apr 13 '18 at 12:04
  • Thanks @grijan, but I did not see anything about npm itself there. Did I miss something? – Leo Apr 13 '18 at 16:24
  • in the link? i do not follow you – Grijan Apr 16 '18 at 04:53
  • 1
    There seems to be an issue with that version: https://github.com/npm/npm/issues/20063 – Dmitri Zaitsev Apr 23 '18 at 12:57

1 Answers1

1

On Windows note that there is a difference between running

npm install -g npm

when running as a normal user in a non-elevated command prompt, and running it in an elevated "Administrator" command prompt.

First, determine where npm is installed

where npm

If npm is installed under "Program Files", then you'll want to be in an elevated Administrator command prompt when you upgrade. If npm is installed under your user's AppData folder, then you'll want to be running as your user in a non-elevated command prompt.

AkinsTech
  • 154
  • 6