Npm upgrade version windows

Try the latest stable version of npm

Table of contents

See what version of npm you’re running

Upgrading on *nix (OSX, Linux, etc.)

(You may need to prefix these commands with sudo , especially on Linux, or OS X if you installed Node using its default installer.)

You can upgrade to the latest version of npm using:

Or upgrade to the most recent release:

Upgrading on Windows

Microsoft wrote a small command line tool to automate the steps below. You can go and download it here — or stick with the manual path outlined below.

By default, npm is installed alongside node in

C:\Program Files (x86)\nodejs

npm’s globally installed packages (including, potentially, npm itself) are stored separately in a user-specific directory (which is currently

Because the installer puts

C:\Program Files (x86)\nodejs

on your PATH , it will always use the version of npm installed with node instead of the version of npm you installed using npm -g install npm@ .

To get around this, you can do one of the following:

Option 1: edit your Windows installation’s PATH to put %appdata%\npm before %ProgramFiles%\nodejs . Remember that you’ll need to restart cmd.exe (and potentially restart Windows) when you make changes to PATH or how npm is installed.

Option 2: remove both of

Option 3: Navigate to %ProgramFiles%\nodejs\node_modules\npm and copy the npmrc file to another folder or the desktop. Then open cmd.exe and run the following commands:

If you installed npm with the node.js installer, after doing one of the previous steps, do the following.

  • Go into %ProgramFiles%\nodejs\node_modules\npm and copy the file named npmrc in the new npm folder, which should be %appdata%\npm\node_modules\npm . This will tell the new npm where the global installed packages are.
  • Copy the npmrc file back into %ProgramFiles%\nodejs\node_modules\npm

(See also the point below if you’re running Windows 7 and don’t have the directory %appdata%\npm .)

A brief note on the built-in Windows configuration

The Node installer installs, directly into the npm folder, a special piece of Windows-specific configuration that tells npm where to install global packages. When npm is used to install itself, it is supposed to copy this special builtin configuration into the new install. There was a bug in some versions of npm that kept this from working, so you may need to go in and fix that up by hand. Run the following command to see where npm will install global packages to verify it is correct.

If it isn’t set to :\Users\ \AppData\Roaming\npm , you can run the below command to correct it:

Incidentally, if you would prefer that packages not be installed to your roaming profile (because you have a quota on your shared network, or it makes logging in or out from a domain sluggish), you can put it in your local app data instead:

. as well as copying %APPDATA%\npm to %LOCALAPPDATA%\npm (and updating your %PATH% , of course).

Everyone who works on npm knows that this process is complicated and fraught, and we’re working on making it simpler. Stay tuned.

Npm upgrade version windows

🚀 Upgrade npm on Windows

Use Git or checkout with SVN using the web URL.

Work fast with our official CLI. Learn more.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

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 ❤️ for npm and Node, reducing the process to a simple command.

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 .

Читайте также:  Редактирование boot ini windows

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 v8, please install an older version for older versions of Node.js.

Want to just install the latest version? Sure:

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!

Usage: npm-windows-upgrade [options]

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.

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

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

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

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 ❤️ 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.

Older Node.js Versions

  • For Node versions lower than v8.0, please use npm-windows-upgrade@5.0.0
  • For Node versions lower than v6.0, please use npm-windows-upgrade@4.1.1
  • For Node versions lower than v4.0, please use npm-windows-upgrade@3.1.1

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!

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.

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

How to upgrade node.js on Windows?

I already have Node.js v0.8.0 running on Windows. Can I just run the latest installer to upgrade it to v0.8.4? I am afraid it will break existing third party modules on my machine.

9 Answers 9

Yes, you just install the latest version. Generally you shouldn’t have any compatibility problems if you are already using the same major version (e.g. Version 0.8.x). If you are concerned about changes, you can always check the changelog for each version (link to changelog is on node.js download page at nodejs.org). That should tell you of any big changes (i.e API changes, etc).

For the record, I have just gone through the process, and it is painless even if you upgrade to another major version.

I have moved from 0.8 to 0.10, using the .msi package, overwriting the one installed on my system. Package problems were all fixed with npm update -g . Worked like a charm.

Читайте также:  Не дает запустить установку windows

In case it does not work like a charm:

npm cache clean usually fixes the problem. Once the cache is empty, just run npm update -g again.

In case you really run into trouble:

Delete the modules you have installed globally, then reinstall them. Here’s how:

Take stock of what you have: npm list -g —depth=0 lists all top-level packages, with version numbers. npm list -g —parseable —depth=0 > npm-global-modules.txt writes them to a file in your cwd.

Any strange stuff you didn’t install yourself has probably been installed by another module (rare, but I have seen it happen). Remove those modules from the list. Also remove the module «npm».

In an editor, format the output for the command line by replacing \n?[^\n]+[\\/] (regex) with a single space.

(I didn’t get this to work with findstr in a pipe, hence the roundtrip to the editor. You can also do it manually, of course 😉

Delete all modules. On Windows, delete (or rename) the %appdata%\npm directory. For other OS, see Command to remove all npm modules globally?

Reinstall the modules with npm install -g [your module list here] . Don’t forget to npm cache clean before you do it.

Как обновить node.js для Windows

Нехитрый и в тоже время простой способ как можно обновить Node JS на устройстве Windows

Только что обновил у себя Node.js и думаю что стоит об этом записать, чтоб потом долго не тормозить когда буду обновлять в следующий раз.

Всё началось с того, что обновлял пакеты NPM и решил проверить какая версия Node.js у меня установлена. Ввёл в консоле:

Выдало что у меня на компе установлена версия v8.9.1

Посмотрел на оф сайте — а последняя рекомендуемая уже v10.15.1. Прикинул — года полтора я Node.js точно не обновлял. Ну и начал гуглить «Как обновить nodejs. «

Это просто жесть:

Поставьте хрень которая будет обновлять Node.js

Если вы попали сюда тоже из гугля то вероятно только что вы уже натыкались на подобные советы и тоже подумали:

а какую потом хрень ставить чтоб обновить ту хрень которая обновляет Node.js ?

Ещё советчики дают трёхстрочные коды для консоли — ваще ни хренашеньки не понятно. Одна муть и жесть.

Но всё таки я наткнулся и нашёл тот самый дельный совет как обновить у себя нод. Всё вообще банально просто:

Заходим на сайт Node.js и скачиваем последнюю рекомендуемую версию. Закрываем консоль если она открыта и запускаем скачанный установщик Node.js (делаем обычную установку как будто с нуля устанавливаем).

На всё про всё ушло около трёх минут. Пакеты NPM обновляются дольше. Установщик Node.js не дурак, всё сделает как надо.

В общем, теперь у меня стоит последняя версия node.

*** Авторизируйтесь чтобы писать комментарии.

Here’s How to Update Node.js Via Visual Studio, NPM, Windows/Mac

I hope that you will find Node version 12 new capabilities compelling and soon you will upgrade your app to it.

In turn, you will get advanced debugging, intelligent coding with the powerful IntelliSense engine, interactive window, quick tracking of performance issues, unit testing, typescript integration, source control, cloud integration, and npm integration.

To get started in this walkthrough, this post captures the steps on how to update Node.js in Visual Studio, Windows/macOS, and NPM.

First, see a couple of useful tricks to check which Node.js npm version you have installed:

Write the command line to update Node.js npm:

“node -v” or “npm -v” simply type the one you want to check.

If the installed version of npm is not the latest one, you can update it using the syntax code:

(Note: The -g flag is used to update npm globally.)

Secondly, see which Node/Npm version Visual Studio you are using.

Now, use Visual Studio Command Prompt that is also called Visual Studio plugin. It can help you open a command line.

If you are not able to use Visual Studio Command Prompt, you can use the “Task Runner Explorer” by adding a task and running it in this way:

Another way is using C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\” on your Window’s.

(Note: This way you will come to know about the local version of your Visual Studio.)

If you have any issues with these steps, you can call for help from the industry’s best Node.js developers on a particular project on which you happen to be working.

Читайте также:  Linux which shared library is being used

All of this is fine. A developer is expecting to have Node.js updated on Microsoft Visual Studio that supports all those new features.

Steps to Update Node.js in Visual Studio

Development teams usually build one or two node.js update strategy that can be sometimes using an automated process. Or, sometimes updates can be based on the goodwill of the developer. The second one seems to be the riskiest approach. Consider applying the first strategy by using automated tools to update node.js.

For Example:

The tool like greenkeeper offers automatic dependency management for node.js npm dependencies. It improves your code quality, catches problems that you would have missed, easy to use, and reliable.

So, if you wish to get an update Node.js, there’re actually simple ways to do so. Here are the ways how to update node.js in Visual Studio and various operating systems.

Start by installing the new global version on node.js on your computer. Simply visit the Node.js download page and start installing the new version. Like the newest version, Node 12 is packed with notable features.

  • Node 12 runs on the V8 engine for faster JavaScript execution
  • Improved startup time by 30%
  • Node 12 supports TLS 1.3 for increased security of codes
  • N-API improvements to prevent libraries from breaking

To tell Visual Studio to use the global version follow the command:

Go to Tools > Options > Projects and Solutions > External Web Tools

Visual Studio uses the $(PATH) to look for its external tools. When performing node.js installation make sure that the $(PATH) should be first on your list.

If that doesn’t work, you can restart the Visual Studio. Or, you can add the usual path directly to the list in which node.js is installed by clicking on “Add” and set “C:\Program Files\nodejs\.” Now, restart the system and recheck the node.js update process.

(Note: If it doesn’t work, make sure node.js is actually installed in that folder. If it is there, but still not work, try uninstalling, remove that folder manually, and install it again.)

How to Update Node.js on Windows and Mac Operating System?

Already familiar with the Node.js updating steps on Windows. Great, these are the foundation of a successful development strategy. However, in the past decade, the node.js development world had gone through dramatic changes but the updating processes were left intact. Some modern node.js update techniques can even replace the traditional ones to give you a better and leaner update strategy with a better ROI.

Example:

If you wish to upgrade Node.js on Windows and Mac OS, then simply visit the Node.js homepage and select your operating system.

From there, a wizard will magically update your Node, and replace the older version with the new one.

Now, See How to Update Node.js Using npm (Node Package Manager)

To update node.js you can use Node Package Manager (npm) that is already preinstalled. But before you start updating node.js, make sure your npm is of the latest version. Here are a few simple steps to follow to update your npm.

First, you need to find out the version of your Node Package Manager (npm), by running npm -v command.

After checking the version, you can run the command npm install npm@latest -g to install the latest version of Node Package Manager.

Finally, use the command npm -v to check whether your new version of npm was successfully installed or not.

Further, to update node.js using npm, use n module. Also, use the following code to clear cache memory from your Node Package Manager and install the latest version of node.js:

(Note: If you are looking for a specific version of node.js, you can also use the command n #.#.#.)

Also, See the Steps for Updating NPM (Node Package Manager) in Visual Studio
This will not take much of your time. If you have installed node.js from their official website, you probably have installed NPM with it. To check it, you can use the command line: “npm-v” .

To upgrade npm in Visual Studio, you can follow the command:

This is how you can update Visual Studio’s NPM version to the latest one.

Оцените статью