Install npm (Node.js Package Manager) on Windows (w/o using Node.js MSI)

前端 未结 11 1951
孤独总比滥情好
孤独总比滥情好 2020-12-23 12:53

The problem: while using nvm to install Node.js I was able to install the version of Node.js I need, but nvm does not install npm auto

11条回答
  •  囚心锁ツ
    2020-12-23 12:55

    I used quite @Eyuel method:

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

    Now you should have node + npm working, use theses commands to check: node --version and npm --version

    Update 27/07/2017 : I noticed that the latest version of node 8.2.1 with the latest version of npm are quite different from the one I was using at the time of this answer. The install with theses versions won't work. It is working with node 6.11.1 and npm 5.2.3. Also if you are running with a proxy don't forget this to connect on internet :

    • export http_proxy=http://proxy:8080
    • export https_proxy=http://proxy:8080
    • npm config set proxy http://proxy:8080

提交回复
热议问题