npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

npm-windows-upgrade

v6.0.1

Published

Upgrade npm on Windows, easily and automatically

Downloads

12,159

Readme

Upgrade npm on Windows

Upgrading npm on Windows requires manual steps to ensure that PowerShell/CMD find the new version of npm. This is a small tool made with :heart: for npm and Node, reducing the process to a simple command.

Usage

First, ensure that you can execute scripts on your system by running the following command from an elevated PowerShell. To run PowerShell as Administrator, click Start, search for PowerShell, right-click PowerShell and select Run as Administrator.

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

Then, to install and use this upgrader tool, run the following command (also from an elevated PowerShell or cmd.exe). Note: This tool requires at least Node v6. For Node versions lower than 4.0, please use [email protected], for Node versions lower than 6.0, please use [email protected].

npm install --global --production npm-windows-upgrade
npm-windows-upgrade

Want to just install the latest version? Sure:

npm-windows-upgrade --npm-version latest

The tool will show you a list of all the published and available versions of npm (including pre-release and beta versions). Choose the one you want to install and let it do its thing!

Advanced Usage

Usage: npm-windows-upgrade [options]

Options:

-h, --help                        Output usage information
-V, --version                     Output the version number
-d, --no-dns-check                Disable the internet connectivity test
-e, --no-execution-policy-check   Disable the PowerShell execution policy test
-p, --no-spinner                  Disable the spinner animation
-n, --npm-path <path>             (Optional) If passed, npm will be upgraded in the specified location
-v, --npm-version <version>       (Optional) If passed, npm will be upgraded/downgraded to the specified version

If you have trouble with the script, consider adding parameters manually. A common issue is that the script fails to find npm (and therefore doesn't know where to install it) - in that case, pass the location manually.

npm-windows-upgrade --npm-path "C:\nodejs"

To manually specify a version to install, pass the version parameter:

npm-windows-upgrade --npm-version 5.5.0

To override the internet connection check, pass --no-dns-check. To disable the initial prompt, pass --no-prompt.

Debug Mode

To see debug output, set a DEBUG environment variable ($env:DEBUG="npm-windows-upgrade")

Issues & Support

Please do report your issues on GitHub. There are a bunch of Windows versions, hundreds of different ways to install Node and npm, and it's likely that this script won't work with a few of them. If you run into trouble and need npm upgraded as soon as possible, please follow the manual instructions.

This tool was made with :heart: for npm and Node, but it is provided "as is", without warranty of any kind, expressed or implied. For details, please consult the LICENSE file.

Fix an Attempted Upgrade

Chances are that you attempted to upgrade npm before, it somehow failed, and you then went looking for this tool. If the tool fails to upgrade, it may be troubled by partial changes done during npm install npm or npm upgrade npm. In that case, you will have to completely uninstall Node:

  • Uninstall Node.js (select Uninstall, not the Repair option).
  • Go into %programfiles%\nodejs and delete the entire folder.
  • Delete %appdata%\npm and %appdata%\npm-cache.
  • Edit your PATH and remove everything that references npm (to do so, hit "Start" and search for "Environment Variables").
  • Reinstall Node, then install this tool - and only use this tool to upgrade npm, do not attempt to run npm install npm.

:memp: Used Chocolatey? If you used Chocolatey (https://chocolatey.org/) to install Node.js, be sure to check if npm is removed from the choco\bin directory by running the following command: where.exe npm. Should it still be there, you will need to either choco uninstall npm or delete the files from this bin directory.

More Useful Node.js Stuff

Microsoft is working hard to make sure that our users have the best possible experience with Node.js. For a helpful set of content that makes it easier to avoid any potential gotchas, go check out our Node.js Guidelines - a collection of tips and advanced best practices!

Contributing

Contributions are extremely welcome! For JavaScript code, please run grunt test to check your code against JSCS and JSHint. There's no formal coding guideline for the PowerShell pieces of this tool, but do write code that is commented and comprehensible.

License

MIT, please see LICENSE for details. Copyright (c) 2015 - 2017 Felix Rieseberg.