Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 601
Anthony O. Avatar asked May 04 '16 13:05

Anthony O.


People also ask

Can I install node js without admin rights?

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.


3 Answers

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.

like image 138
Anthony O. Avatar answered Oct 08 '22 03:10

Anthony O.


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
like image 38
joerno Avatar answered Oct 08 '22 03:10

joerno


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
like image 15
chidimo Avatar answered Oct 08 '22 04:10

chidimo