使用NVM管理Node - Windows
生活随笔
收集整理的這篇文章主要介紹了
使用NVM管理Node - Windows
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
安裝 NVM
NVM 下載:https://github.com/coreybutler/nvm-windows
安裝 Node
注意:如果沒有FQ默認源可能安裝npm失敗,請參考下一節“安裝 NPM”修改鏡像源地址。
- 查看可用版本: nvm ls available
- 安裝Node:
nvm install [version] - 指定使用版本: nvm use [version]
安裝 NPM
nvm全稱Node Version Manager是 Nodejs 版本管理器,它讓我們能方便的對 Nodejs 的版本進行切換。
使用默認源可能安裝npm失敗,需要修改../nvm/settings.txt文件,添加如下配置。
root: C:\dev\nvm path: C:\dev\nodejs arch: 64 proxy: none node_mirror: http://npm.taobao.org/mirrors/node/npm_mirror: https://npm.taobao.org/mirrors/npm/安裝NRM
nrm(npm registry manager)是npm的鏡像源管理工具,有時候國外資源太慢,那么我們可以用這個來切換鏡像源。
- 安裝nrm npm install nrm -g
- 查看可用鏡像源 nvm>nrm ls* npm ---- https://registry.npmjs.org/cnpm --- http://r.cnpmjs.org/taobao - https://registry.npm.taobao.org/nj ----- https://registry.nodejitsu.com/rednpm - http://registry.mirror.cqupt.edu.cn/npmMirror https://skimdb.npmjs.com/registry/edunpm - http://registry.enpmjs.org/
- 選擇使用鏡像源 nrm use taobao
NVM 命令
Usage:nvm arch : Show if node is running in 32 or 64 bit mode.nvm install <version> [arch] : The version can be a node.js version or "latest" for the latest stable version.Optionally specify whether to install the 32 or 64 bit version (defaults to system arch).Set [arch] to "all" to install 32 AND 64 bit versions.Add --insecure to the end of this command to bypass SSL validation of the remote download server.nvm list [available] : List the node.js installations. Type "available" at the end to see what can be installed. Aliased as ls.nvm on : Enable node.js version management.nvm off : Disable node.js version management.nvm proxy [url] : Set a proxy to use for downloads. Leave [url] blank to see the current proxy.Set [url] to "none" to remove the proxy.nvm node_mirror [url] : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.nvm npm_mirror [url] : Set the npm mirror. Defaults to https://github.com/npm/npm/archive/. Leave [url] blank to default url.nvm uninstall <version> : The version must be a specific version.nvm use [version] [arch] : Switch to use the specified version. Optionally specify 32/64bit architecture.nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode.nvm root [path] : Set the directory where nvm should store different versions of node.js.If <path> is not set, the current root will be displayed.nvm version : Displays the current running version of nvm for Windows. Aliased as v.參考鏈接
https://www.runoob.com/w3cnote/nvm-manager-node-versions.html
https://blog.csdn.net/qq_27626333/article/details/77857223
轉載于:https://www.cnblogs.com/io_oti/p/9350653.html
總結
以上是生活随笔為你收集整理的使用NVM管理Node - Windows的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python自动轨迹绘制七边形_断面法计
- 下一篇: hacker rank bash