如何做双版网站,企业网站建设方案教程,网站制作做站长挣钱,郑州网站开发培训文章目录 Nvm管理NodeJs版本一、前言1.简介2.环境 二、正文1.卸载NodeJs2.安装Nvm3.配置国内镜像4.Nvm使用5.其它1#xff09;报错12#xff09;报错2 Nvm管理NodeJs版本
一、前言
1.简介
Node Version Manager#xff08;nvm#xff09;可通过命令行快速安装和使用不同… 文章目录 Nvm管理NodeJs版本一、前言1.简介2.环境 二、正文1.卸载NodeJs2.安装Nvm3.配置国内镜像4.Nvm使用5.其它1报错12报错2 Nvm管理NodeJs版本
一、前言
1.简介
Node Version Managernvm可通过命令行快速安装和使用不同版本的Node.js
2.环境
Windows 10 专业版nvm 版本v1.1.11 nvm - githubhttps://github.com/nvm-sh/nvm nvm - Releaseshttps://github.com/coreybutler/nvm-windows/releases Node.js 版本https://nodejs.org/en/download/releases Vuejs入门和使用实践https://blog.csdn.net/u011424614/article/details/94478809 vue集成cesiumhttps://blog.csdn.net/u011424614/article/details/103403275 二、正文
1.卸载NodeJs 如未安装过 Node.js 可跳过第 1 步 1使用 Windows 的 应用和功能 卸载 Node.js
2删除 .npmrc 文件
C:\Users\用户名\.npmrc3清除 npm 缓存
npm cache clean --force4删除以下 npm 文件夹
C:\Users\用户名\AppData\Roaming\npm
C:\Users\用户名\AppData\Roaming\npm-cache2.安装Nvm
下载 nvmhttps://github.com/coreybutler/nvm-windows/releases推荐下载
nvm-noinstall.zip 绿色免安装版nvm-setup.exe 安装版【推荐使用】
双击 nvm-setup.exe 安装文件按步骤安装即可建议安装目录是无空格和无特殊字符的全英文目录 3.配置国内镜像
查询 nvm 安装目录
where nvm安装目录下找到 settings.txt 写入淘宝镜像
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/4.Nvm使用
查询
命令说明nvm list显示已安装的 Node.js 版本nvm list installed显示已安装的 Node.js 版本nvm list available显示所有可下载的 Node.js 版本npm -v显示 npm 版本node -v显示 Node.js 版本
安装
命令说明nvm install 12.20.1nvm install 14.21.3nvm install 18.18.2安装指定的 Node.js 版本nvm install latest安装最新的 Node.js 版本
使用
命令说明nvm use 12.20.1使用指定的 Node.js 版本
卸载
命令说明nvm uninstall 12.20.1卸载指定的 Node.js 版本
其它
命令说明nvm arch显示 Node.js 运行的系统位数32位或64位nvm on开启 Node.js 版本管理nvm off关闭 Node.js 版本管理nvm version显示 nvm 版本nvm proxy [url]设置下载代理不加可选参数 url则显示当前代理如 url 设置为 none则移除代理nvm root [path]设置存储不同版本 Node.js 的目录如果未设置则默认使用当前目录nvm node_mirror [url]设置 Node.js 镜像设置后可在安装目录下的 settings.txt 查看nvm npm_mirror [url]设置 npm 镜像设置后可在安装目录下的 settings.txt 查看
5.其它
1报错1
错误提示
node 不是内部或外部命令也不是可运行的程序或批处理文件。解决方法
1找到 nvm 的安装目录
2安装目录下新建 nodejs 文件夹
3环境变量中的用户变量和系统变量找到 NVM_SYMLINK 配置 nodejs 的目录
4使用 nvm use 12.20.1 切换 Node.js 环境
2报错2 场景说明nvm 切换 Node.js 版本后而 npm 版本未切换 解决方法
1使用 Windows 的 应用和功能 卸载 Node.js
2删除 .npmrc 文件
C:\Users\用户名\.npmrc3清除 npm 缓存
npm cache clean --force4删除以下 npm 文件夹
C:\Users\用户名\AppData\Roaming\npm
C:\Users\用户名\AppData\Roaming\npm-cache3清除 npm 缓存
npm cache clean --force4删除以下 npm 文件夹
C:\Users\用户名\AppData\Roaming\npm
C:\Users\用户名\AppData\Roaming\npm-cache