Install npm (Node.js Package Manager) on Windows (without using Node.js MSI)

Problem: when using nvm to install Node.js, I was able to install the Node.js version I need, but nvm does not install npm automatically. There is no installation information on the NPM page. Being not a very big Windows user, I am completely at a loss ...

Each result on Google seems to use the Node.js MSI installer to get this working - which is not an option in my case. So how am I?

+55
npm install
Apr 14 '13 at 2:31 on
source share
11 answers

To install npm on windows, just unzip the npm archive where node is. See more details.

npm comes with node, here is how you should install it. nvm is only for changing node versions and does not install npm. An easier way to use npm and nvm is to first install node as is (with npm number) and then install the nvm package npm install nvm

+33
Apr 14 '13 at 19:09
source share

https://nodejs.org/download/ . The page has a Windows installer (.msi), as well as other installers and binaries. Download and install for Windows.

Node.js comes with NPM.

NPM is located in the directory where Node.js. is installed.

+21
Jun 03 '14 at 19:24
source share

I used the @Eyuel method:

  • Download nodejs msi from https://nodejs.org/en/#download
  • Download npm zip from github https://github.com/npm/npm
  • Extract msi (with 7 Zip) to the "node" directory
  • Set the PATH environment variable to add a directory
  • Extract the zip file from npm to another directory (not to the node directory)
  • CD to the npm directory and run the node cli.js install npm -gf

You should now have node + npm working, use command abstracts to verify: node --version and npm --version

Update 07/27/2017 . I noticed that the latest version of node 8.2.1 with the latest version of npm is very different from the one I used during this answer. Installation with abstract versions will not work. It works with node 6.11.1 and npm 5.2.3. Also, if you are working with a proxy server, do not forget to connect to the Internet:

+12
Feb 16 '16 at 8:57
source share

I also needed to install npm on Windows and get it through the Chocolatey pacakage manager. For those who have not heard of this, Chocolatey is a package manager for Windows that gives you the convenience of apt-get in Windows environments. To get it, go to https://chocolatey.org/, where there is a PowerShell script to download and install it. After that you can run:

 chocolatey install npm 

and you are fine.

Note that standalone npm is no longer being updated, and it is known that the latest version that exists has problems on Windows. Another option you can look at is to extract npm from MSI using LessMSI .

+9
Sep 22 '14 at 18:23
source share

The first CD is where node (nodejs) is installed using CMD windows, then follow these steps

 C:...\node> git config --system http.sslcainfo /bin/curl-ca-bundle.crt C:...\node> git clone --recursive git://github.com/isaacs/npm.git C:...\node> cd node=modules\npm C:...\node=modules\npm> node cli.js install npm -gf 
+8
Jan 11 '14 at 6:23
source share

Just download "node.exe" from http://nodejs.org/dist/ , select your favorite version of "node.js" or take the latest . You can also take the 64-bit version from the "x64" subdirectory.

Then go to http://nodejs.org/dist/npm/ to get the zip archive of your favorite version of "npm" (recommended: 1.4.10 ). Extract the archive by "node.exe".

Finally, it is recommended that you add the "node.js" directory to your PATH for convenience.

EDIT: I recommend updating npm using npm install npm -g because the versions provided by nodejs.org are very old.

If you want to keep the original version of npm, do not put npm next to "node.exe" . Just create a directory and use the same command with the "global" flag, and then copy .\node_modules\.bin\npm.cmd to the new directory:

 mkdir c:\app\npm\_latest cd c:\app\npm\_latest <NPM_ORIGINAL_PATH>\npm install npm cp node_modules\.bin\npm.cmd npm.cmd 

Finally, change your PATH to use c:\app\npm\_latest

+7
Feb 20 '15 at 15:54
source share

I wrote a short simple application that handles various versions of node and npm. It allows you to choose a different version of node and npm to download and choose which version to use. Check it out and see what it is useful.

https://github.com/nhatkthanh/wnm

+2
Aug 27 '15 at 6:38
source share

Try going to Window -> Preferences -> Nodeclipse and uncheck "find node in PATH ...". Then make sure that the "Node.js path" below is set to the location of the node.exe file (for me it was C: \ Program Files (x86) \ nodejs \ node.exe).

+1
Jul 30 '15 at 13:01
source share

Download the latest Node.js MSI installer (4.x or 5.x) and run the following command from the command line:

 msiexec /a node-v4.4.3-x64.msi /qb TARGETDIR="C:\Node.js" 

This will extract the binaries to C:\Node.js\nodejs .

Then you need to add the environment variable C:\Node.js\nodejs PATH .

To upgrade NPM, do the following:

 cd C:\Node.js\nodejs npm install npm@latest 

After that, you can check the versions:

 node --version npm --version 

Node should be 4.4.3+ (depending on what you installed), and npm should be 3.8.7 +.

+1
Apr 27 '16 at 2:34
source share

TL; DR: install Chocolatey, Node (and NPM)

Set chocolate

NOTE. You might want to copy the exact command from the installation page, as it may change over time.

  1. Open the standard Windows command prompt
  2. @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH="%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  3. Reboot Console
  4. Done!

Install Node (and NPM)

  1. Since Chocolatey installs a directory other than the MSI installation, go to your system configuration and uninstall the previous node installation (if you have one)
  2. Install Chocolatey as described above
  3. choco install nodejs

    NOTE. I used nodejs . I’m not even sure what node , but if I had a considerable share of problems with node already nodejs with something else on other systems, I thought that nodejs would be a safer bet right away

  4. Reboot Console
  5. Caution: node -v works!
    • And npm -v works too! Awesome.

After that, I was able to install firebase-tools without problems (which I could not do before), so something must have gone wrong! :)

My pretty complete story for the first time

"Chocolate settings in seconds"

If you don't care about sarcasm or grieving engineers on Sunday afternoon, go to the installation instructions in the TL section ; DR below.

For everyone else: I want to change this answer that I recommend using (which now seems like the most popular package management solution for Windows): Chocolatey

It does the job well and fast. However, when I gave him my first try, it took me a while to figure out the installation instructions, which are a bit confusing. Installation instructions go something like this (complete with what I had during the passage):

  • NOTE:
  • NOTE:
  • NOTE:

    three high-profile RECORDS before even knowing the basics ... it bothers me ... how can everything go wrong!?

  • Limited TLS Installation

    I'm not even sure what TLS ... Oh, this is a good friend of SSL - Shouldn't it just be default and just work out of the box? My browser can do HTTPS , no problem! (just kidding ... I know that SSL and TSL often cause a lot of pain in environments with high security requirements)

  • Option 1
  • Option 2

    uh ... fine ... i can't just install?

  • Installation behind a proxy?

    Simply no...

  • Requirements

    uh, fight ...

  • Why is Chocolatey installed by default?

    Jokes aside!?!

  • Before installation

    sad http://www.clipartbest.com/cliparts/jix/Ekx/jixEkxaGT.png

  • Can I install with a proxy?

    again with a proxy ...

  • Can I install a specific version of Chocolatey?

    just any version will be fine, thanks ...

  • Can I use the built-in compression of Windows instead of downloading 7zip?

    7zip ?! Why are you even mentioning this ?!

  • Non-administrative installation
  • Now that sounds great!

    • " NOTE : This option should be a last resort and is considered an advanced scenario."
      • W $% @T.

  • Alternative installation options

    dizzy

  • Command line
    • "This is really the easiest method because it does not require PowerShell to be configured before executing it."

      And here you are!

Although I really appreciate the fact that the pitfalls and their possible solutions are discussed so widely, perhaps reorganizing them as such, and installing Chocolatey installs in seconds promising effective work using the “easiest method” would be awesome!

+1
Dec 11 '16 at 11:45
source share

If you use the update for Windows 10 Creators Update (1703) and conveniently navigate through the Unix terminal, you can achieve this using the built-in Bash function in Ubuntu on Windows (aka Bash / WSL)

This was originally introduced at the start of Build 2016, but many add-ons and bug fixes were covered in the Creators update, but please be careful, this is still in beta.

To enable simple control Control Panel \ All Control Panel Elements \ Programs and Features \ Turn Windows Features On or Off

Then select Windows Subsystem for Linux (Beta) as shown below Bash in the Windows function

0
May 16 '17 at 23:54
source share



All Articles