新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

Windows上node.js的多版本管理工具用法实例分析-创新互联

本文实例讲述了Windows上node.js的多版本管理工具用法。分享给大家供大家参考,具体如下:

创新互联主营托里网站建设的网络公司,主营网站建设方案,成都APP应用开发,托里h5重庆小程序开发搭建,托里网站营销推广欢迎托里等地区企业咨询

在Linux上我一直使用nvm来管理nodejs的不同版本,但是nvm没有windows版本,今天发现在windows上可以使用另外一个版本管理工具nvm-windows来管理。

下载与安装

下载地址:https://github.com/coreybutler/nvm-windows/releases

安装前,这里有一点需要注意,如果以前安装过node,需要先卸载,并且要把目录清理干净。下面是官方给的说明:

It comes with an installer (and uninstaller), because getting it should be easy. Please note, you need to uninstall any existing versions of node.js before installing NVM for Windows. Also delete any existing nodejs installation directories (e.g., "C:\Program Files\nodejs") that might remain. NVM's generated symlink will not overwrite an existing (even empty) installation directory.

You should also delete the existing npm install location (e.g. "C:\Users\AppData\Roaming\npm") so that the nvm install location will be correctly used instead. After install, reinstalling global utilities (e.g. gulp) will have to be done for each installed version of node:

安装的时候需要制定两个目录,一个是nvm的安装目录,一个是建立node软连接的目录。

nvm的安装目录(绝对路径所有层级)中最好不要存在中文或者两个单词以上的路径,如Progrom Files等,否则可能导致命令运行出错。

所有下载的node包在nvm安装目录下,只是在更改了node软连接的目录,并将node软连接目录增加到了环境变量中。原理还是很简单的。

使用

查看当前已经安装的nodejs版本

C:\Users\kongxx> nvm list

No installations recognized.

网站题目:Windows上node.js的多版本管理工具用法实例分析-创新互联
URL地址:http://www.wjwzjz.com/article/ppggi.html
在线咨询
服务热线
服务热线:028-86922220
TOP