Updating npm to latest version

Recently I had some trouble updating npm to the latest version on Windows, which was driving me crazy until a StackOverflow thread pointed me in the right direction.  Unfortunately I can’t find the thread again, but as this was just a passing comment and not an answer, I thought it would be worth immortalising it here. By…