updating node.js in windows 7 64 bit
Asked Answered
S

4

25

How to update node.js in Windows 7 64-bit OS?

I tried the famous :

npm cache clean -f
npm install -g n
n stable

But in npm install -g n it failed giving the following error:

C:\Windows\system32>npm install -g n
npm http GET https://registry.npmjs.org/n
npm http 304 https://registry.npmjs.org/n
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: [email protected]
.9
npm ERR! notsup Valid OS:    !win32
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: ia32

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "n"
npm ERR! cwd C:\Windows\system32
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code EBADPLATFORM
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Windows\system32\npm-debug.log
npm ERR! not ok code 0

Please suggest a solution. I suspect this could be because of the 64-bit version of the OS.

Thanks and regards.

Springs answered 18/7, 2014 at 10:17 Comment(2)
For late visitors, time has changed lots of stuff, and answers described here are all obsolete. Please visit https://mcmap.net/q/258991/-latest-nodejs-compatible-with-windows-7-duplicate/3830926 for newer info instead.Pedate
My answer is not obsolete, I can confirm it is still working!Titter
F
27

You can update simply by executing the Windows installer for the latest node.js version from here.

n doesn't work on Windows because it's basically a giant (bash) shell script.

Futility answered 18/7, 2014 at 11:56 Comment(1)
Link has changed. This link point to the most current version: nodejs.org/en/download/currentMenorca
H
7

Go to System-Properties (run: systempropertiesadvanced.exe), in the Advanced tab, click Environment Variables.

Still on the System variables, click New, add name: NODE_PATH with value: C:\nodejs64\node_modules and click OK. click New' again, add name: NODE_SKIP_PLATFORM_CHECK with value: 1 and click OK.

Click OK of all dialogs close.

Restart your machine, so explore and cmd will get the fresh set of variables.

Hardandfast answered 29/8, 2021 at 0:31 Comment(1)
Do not forget "On the System variables area, look for path and double click that line. add ;C:\nodejs64; at the end of the line, and click OK." - github.com/nodejs/node/issues/33000#issuecomment-644530517Tetherball
T
7

------------------------THIS IS HOW TO UPDATE NODE ON WINDOWS 7---------------------------

  1. Go to https://nodejs.org/en/download/releases and find the version you want and download the .zip file to your appropriate OS. --> 64-bit or x86 for 32-bit

  2. Locate your nodejs folder

    • If you previously installed it with the installer its in your C:\Program Files\nodejs
    • copy this folder and save it somewhere else in case you mess things up
  3. Unzip the new version of nodejs that you downloaded and copy all the files in the folder except the node_modules and paste them in your nodejs folder

    • check yes to replace the files
  4. Open Run (windows key + r) and paste systempropertiesadvanced.exe Then, in Advanced tab, click Environment Variables. On the System variables area, click 'New', add name: NODE_PATH with value: C:\Program Files\nodejs\node_modules, and click OK. click 'New' again, add name: NODE_SKIP_PLATFORM_CHECK with value: 1, and click OK.

    • make sure your NODE_PATH is where ever your nodejs/node_module folder is, mine was in Program Files

restart your computer, so explore and cmd will get the fresh set of variables

In your terminal run node -v and npm -v

You will know you did it right, if it node returns the new version and npm doesn't error

Note you only updated nodejs

I'd imagine you could run npm install -g npm@latest and it would be fine.

Titter answered 7/6, 2022 at 7:13 Comment(5)
confirmed with version 18.12 LTSTitter
Node is super slow after following this procedure. Can you explain why not delete the old node_modules folder and copy in the new node_modules folder?Gutty
I'm under the impression that's where the global packages are installed. How much ram does you computer have? Check the resources nodes consuming in task manager.Titter
Confirmed with version 18.13.0Saury
Confirmed with: Latest LTS Version: v18.17.1 (includes npm v9.6.7) Also ran NPM updated, and am at: v9.8.1 thank you for this step-by-step process.Spathic
I
0

As @mscdex mentioned in the comment above, you cannot use the bash shell script on Windows.

The correct link to update from Windows would be this one.

Then you should click on the right link saying " Current".

Inflect answered 25/9, 2019 at 16:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.