How to update node.js on Windows?

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

+52
Jul 28 '12 at 7:36
source share
7 answers

Yes, you just install the latest version. Generally, you should not have compatibility issues if you are already using the same major version (for example, Version 0.8.x). If you are worried about changes, you can always check the change log for each version (the link to the change log is on the node.js download page in nodejs.org). This should tell you about any big changes (e.g. API changes, etc.).

+39
Jul 28 '12 at 10:25
source share
— -

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

I moved from 0.8 to 0.10 using the .msi package, overwriting the one that is installed on my system. Packaging issues have been fixed with npm update -g . Worked like a charm.

If 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.

If you really run into difficulties:

Remove the modules you have installed around the world, then reinstall them. Here's how:

  • Take a look at 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 on your cwd.

    Any weird things that you didn't install yourself were probably installed by another module (rarely, but I saw how it happened). Remove these modules from the list. Also remove the "npm" module.

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

    (I did not get this to work with findstr in the channel, therefore, round-trip to the editor. Do it manually, of course;)

  • Remove all modules. On Windows, delete (or rename) the %appdata%\npm directory. For other OSs, see the command to remove all npm modules worldwide?

  • Reinstall the modules using npm install -g [your module list here] . Remember npm cache clean before doing this.

+36
Jul 24 '13 at 10:26
source share

I have no experience with node on Windows, but I just updated node and modules on my Mac, so this is just a general answer:

If you install v0.8, you can break existing node modules if they use legacy functions, etc. The problem is that npm only checks your version of node during module installation, and not when -time starts.

To be safe, you need to find the global node_modules folder on your computer, return it there, and then remove and reinstall the modules. You will need to do the same for the node_modules folders in the applications you use. (Assuming you have package.json files, reinstalling them should be easy.)

In practice, I do not think that any of the modules that I used are actually incompatible. Good luck.

+2
Jul 28 '12 at 10:30
source share

If you are not using a module that relies on an actual error that was present in 0.8.0 and was fixed on 0.8.4, you are fine. There were no API changes between the two versions (and the node command is too smart to introduce such changes in a minor release).

+1
Jul 29 '12 at 10:28
source share

Currently updating to 4.4. *. I just used nodejs.org for installation from the site, and that the update everything works fine.

0
Jul 01 '16 at 2:07
source share

Just go to nodejs node and download it. You can install it directly without any hesitation. If you have a dependency on an earlier version, check the change logs.

0
Sep 21 '16 at 13:26
source share

The best way to install node on windows is nvm-windows , so you can quickly switch between versions if you need to. This is similar to the best way to install node on linux and max, i.e. with nvm .

But Benjen is right (as he might not have been with all his intelligence experience) that you can just install a different version of node and your version will be updated. You may need to reinstall your dependencies in npm, and any extensions that are not managed by npm may need to be recompiled, but this will be true no matter how you change the version of node.

0
05 Oct '16 at 23:15
source share



All Articles