文章目录
首页
Javascript
Html
Css
Node.js
Electron
移动开发
工具类
服务端
浏览器相关
前端收藏
其他

windows下利用nvm安装node,管理node版本

2018年12月29日 发布 阅读(387) 作者:懒炖

nvm github: https://github.com/coreybutler/nvm-windows/releases

下载安装

下载https://github.com/coreybutler/nvm-windows/releases/download/1.1.7/nvm-setup.zip
并安装


设置环境变量

安装成功需要设置环境变量,否则还是没法用的,报错如下

  1. D:\project\imqianduan>nvm
  2. 'nvm' is not recognized as an internal or external command,
  3. operable program or batch file.
  4. D:\project\imqianduan>

windows下设置环境变量: 计算机(右键)=>属性=>高级系统设置=>环境变量

1、新建一个系统变量 NVM_HOME,其值为C:\nvm
2、新建一个系统变量 NVM_SYMLINK其值为C:\Program Files\nodejs
3、看下系统变量Path后面有没有加C:\nvmC:\Program Files\nodejs,有的话删除,没有的话,在后面加上;%NVM_HOME%;%NVM_SYMLINK%;

记得环境变量 ;分号的处理,NVM_HOME和NVM_SYMLINK路径设置为自己的安装路径

  1. D:\project\imqianduan>nvm
  2. Running version 1.1.7.
  3. Usage:
  4. nvm arch : Show if node is running in 32 or 64 bit mode.
  5. nvm install <version> [arch] : The version can be a node.js version or "latest" for the latest stable version.
  6. Optionally specify whether to install the 32 or 64 bit version (defaults to system arch).
  7. Set [arch] to "all" to install 32 AND 64 bit versions.
  8. Add --insecure to the end of this command to bypass SSL validation of the remote download server.
  9. nvm list [available] : List the node.js installations. Type "available" at the end to see what can be installed. Aliased as ls.
  10. nvm on : Enable node.js version management.
  11. nvm off : Disable node.js version management.
  12. nvm proxy [url] : Set a proxy to use for downloads. Leave [url] blank to see the current proxy.
  13. Set [url] to "none" to remove the proxy.
  14. nvm node_mirror [url] : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.
  15. nvm npm_mirror [url] : Set the npm mirror. Defaults to https://github.com/npm/cli/archive/. Leave [url] blank to default url.
  16. nvm uninstall <version> : The version must be a specific version.
  17. nvm use [version] [arch] : Switch to use the specified version. Optionally specify 32/64bit architecture.
  18. nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode.
  19. nvm root [path] : Set the directory where nvm should store different versions of node.js.
  20. If <path> is not set, the current root will be displayed.
  21. nvm version : Displays the current running version of nvm for Windows. Aliased as v.
  22. D:\project\imqianduan>

nodejs历史版本列表

https://nodejs.org/zh-cn/download/releases/

版权声明:本站文章除特别声明外,均采用署名-非商业性使用-禁止演绎 4.0 国际 许可协议,如需转载,请注明出处

评论

  •