How to install NodeJS LTS on Windows as a local user (without admin rights)

node.jsWindowsNpm

node.js Problem Overview


I'm using Windows as a simple user (I don't have any admin rights) and want to install NodeJS LTS.

On the download site I have the choice to download only the binary node.exe (which don't includes npm) or the node.msi installer which requires the admin rights to execute.

How can I manually install node.exe and also be able to use npm?

node.js Solutions


Solution 1 - node.js

UPDATE 10/2018

On Node's download page referenced in step 1. there is now a .zip archive download which contains both the nodejs executable and npm. Unpacking that to a suitable path and adding this path to your PATH environment variable (step 2.) will give you both node and npm (so you can skip steps 3. - 6.).

Let say you want to install it into %userprofile%\Applications\nodejs-lts, let's name it <NODE_PATH>.

  1. Download the LTS node.exe binary for Windows and copy it to <NODE_PATH>.

  2. Add <NODE_PATH> to your PATH environment variable (set PATH=<NODE_PATH>;%PATH% or using Windows user interface)

  3. Download the stable at https://registry.npmjs.org/npm/-/npm-{VERSION}.tgz npm package (following the documentation)

  4. Unzip the npm-{VERSION}.tgz anywhere (using 7zip for example)

  5. Launch a cmd and cd into the place where you have unzipped npm

  6. Execute: node cli.js install -gf or node bin/npm-cli.js install npm -gf on certain versions (thanks to this comment)

The last command is specified in the Makefile for target install, target which the README.md invites to execute when manually installing.

Solution 2 - node.js

The nodejs version of 6.11 LTS and later seems to be easier to install, because npm is already included.

  1. Download the node.js LTS binary for Windows and extract it to your desired location
  2. Add the path of the nodejs folder to the PATH environment variable: (Shortcut winkey+R and enter: rundll32 sysdm.cpl,EditEnvironmentVariables)
  3. Open a new command window (winkey+R and type cmd)
  4. Type node -v and npm -v to verify the installation

Solution 3 - node.js

Just download the windows binary (NOT the msi installer) from here, unzip the file, then add the location of the node.exe file to system path. This means that after unzipping the downloaded binary, you get a folder, then you have to open that folder itself. That is the path you should add to system path.

To add to system path, do this, thanks to Abdel Raoof

Open Run with dialog (Win + R). Copy and paste this line in your command line

rundll32 sysdm.cpl,EditEnvironmentVariables.

In User variables for user_name (the top window) path of your environment variables dialog add the path to your unzipped node download. To check for successful installation

node -v

npm -v

Solution 4 - node.js

  1. Download the node.js zip file from official page. https://nodejs.org/en/download/
  2. Unzip the file.
  3. Goto Edit Environment Variables For Your Account.
  4. Add new path /node-v10.14.2-win-x64\node-v10.14.2-win-x64
  5. That's it... now you have installed both node.js and npm.
  6. Use node -v and npm -v to check installation.

Solution 5 - node.js

Add following paths to the PATH environment variable, if you have downloaded the Node.js Windows Binary (.zip)

  1. <your os root>\node-v10.16.1-win-x64\
  2. <your os root>\node-v10.16.1-win-x64\node_modules\npm\bin\

Then test following commands from the command prompt:

node -v

npm -v

Solution 6 - node.js

The answer provided is too old now. Portable download for Node (including NPM) is available as a zip download and it word just out of the box. you just need to add the folder to the path.

Solution 7 - node.js

For node portable installation in windows batch file with below command can also be created in node root directory(where node.exe file resides) which updates PATH environment variable on execution and also directly through command prompt from node root directory

PATH %~dp0;%PATH%;

~dp0 : fetches current directory path in windows

Hopes that Helps

Solution 8 - node.js

Accepted answer from @Anothony O. didn't work for me. If got it working following these instructions and by adding the following to node\node_modules\npm\npmrc

strict-ssl=false

Solution 9 - node.js

As others have pointed out, npm is now included with the binary (.zip) node download. So installing node and npm without admin rights is straightforward, though you need to manually add the node directory to the PATH environment variable.

However, as of v8.11.4, the binary was including npm v5.6.1. Running npm install npm@latest -g complained about not being able to delete npm.cmd and npx.cmd. Moving those files out of the node directory fixes that, but then you can't simply run npm on the command line, because npm.cmd is no longer on the node path.

Trying @Anthony O's approach of downloading the latest npm .zip and installing from there didn't work either, as it was complaining about rimraf not being installed. It seemed like maybe the npm install script was assuming rimraf was installed globally.

What finally worked was changing to the node directory and specifying the full path to npm-cli.js from there:

node node_modules/npm/bin/npm-cli.js install -g npm@latest

I see that the node v8.12.0 package that was just released now includes npm v6.4.1, so the above shouldn't be necessary for now.

Solution 10 - node.js

Source: https://medium.com/@github.gkarthiks/how-to-install-nodejs-and-npm-in-non-admin-access-windows-machines-102fd461b54c:


Step 1: Download the nodeJS.exe file from https://nodejs.org/en/download/ by clicking on All download options (example: https://nodejs.org/dist/v12.16.1/) and choose the right Windows architecture and download it.

Step 2: Choose a folder for nodeJS. For example, C:\ProgramData\Applications\nodejs and save the downloaded file under this folder.

Step 3: Add the nodeJS folder to the environment variable PATH by executing the below command in the cmd.exe, or using the User Interface. set PATH=C:\ProgramData\Applications\nodejs;%PATH% OBS! Remember to restart your computer after setting the environment variable. (Windows 10)

Step 4: Now download the stable version of npm from the below link by replacing the version. https://registry.npmjs.org/npm/-/npm-{VERSION}.tgz For example for npm version 6.4.1, https://registry.npmjs.org/npm/-/npm-6.4.1.tgz

Step 5: Now unzip the downloaded npm file anywhere and cd into package folder. (I used convert.io to convert tgz to zip for unzipping in Windows 10 https://convertio.co/tgz-converter/)

Step 6: Execute the following command in the cmd.exe

node bin/npm-cli.js install npm -gf

Step 7: Execute the following commands to verify the installation of nodeJS and npm.

node -v
npm -v

Solution 11 - node.js

Download the node js zip file, extract it to a folder. Then create a windows batch file to set path to node js folder(as you may not be able to set path the usual way witout admin rights). Then run your node/npm/npx commands from the same command window. You even can open Visual Studio Code from there. If you need step by step checkout this video : https://youtu.be/BLnbtsDIW_E

Solution 12 - node.js

Try GitHub n-install:

> curl -L https://git.io/n-install | bash -s -- -y

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAnthony O.View Question on Stackoverflow
Solution 1 - node.jsAnthony O.View Answer on Stackoverflow
Solution 2 - node.jsjoernoView Answer on Stackoverflow
Solution 3 - node.jschidimoView Answer on Stackoverflow
Solution 4 - node.jsBhargavView Answer on Stackoverflow
Solution 5 - node.jsRahamathView Answer on Stackoverflow
Solution 6 - node.jsRPSView Answer on Stackoverflow
Solution 7 - node.jsImranView Answer on Stackoverflow
Solution 8 - node.jsNebuView Answer on Stackoverflow
Solution 9 - node.jsjdunningView Answer on Stackoverflow
Solution 10 - node.jsjeppoo1View Answer on Stackoverflow
Solution 11 - node.jsDon SrinathView Answer on Stackoverflow
Solution 12 - node.jswayofthefutureView Answer on Stackoverflow