当前位置:网站首页>使用nvm管理nodejs(把高版本降级为低版本)
使用nvm管理nodejs(把高版本降级为低版本)
2022-07-01 12:34:00 【Yunlord】
前言
刚开始学习springboot+vue框架,最麻烦的就是配置环境,尤其是网上下的模板所需的版本不一的问题。
为了解决这个问题,今天主要介绍前端vue的环境配置,我们通过nvm管理不同版本的node,实现无缝衔接。
一、nvm、npm、node介绍
1.区别
- nvm:nodejs 版本管理工具,也就是说:一个 nvm 可以管理很多 node 版本和 npm 版本。
- nodejs:在项目开发时的所需要的代码库。
- npm:nodejs 包管理工具,在安装的 nodejs 的时候,npm 也会跟着一起安装,它是包管理工具,npm 管理 nodejs 中的第三方插件。
2.关系
nvm管理nodejs和npm的版本,npm可以管理nodejs的第三方插件。

二、nvm安装步骤
1.卸载之前的node
进入控制面板,打开卸载或更改程序,搜索node.js,找到所安装的node.js并卸载。
2.下载nvm管理工具
从官网下载安装包 https://github.com/coreybutler/nvm-windows/releases,下载红框里面的那个。

3.运行nvm-setup.exe文件
(1)选择“我接受…”那一行,点击next
(2)可以根据自身情况自定义选择路径盘,路径不要出现空格或中文符号
(3)选择node.js的安装位置,可以根据自身情况自定义选择路径盘,路径不要出现空格或中文符号
(4)最后一步,点击install即可安装完成
4.检验是否安装成功
nvm v如果出现版本号,即安装成功(如果安装不成功,查看之前自己安装的node.js有没有删除彻底、安装nvm工过程有没有漏掉什么!)。
5.添加镜像
安装完成之后,我们还要在设置文件里面添加淘宝镜像,这样我们可以选择下载的nodejs版本选择比较多下载速度也快
在nvm的安装路径下面找到setting.txt文件、打开编辑。
在setting.txt文件里面加入:
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/三、安装node.js版本
1.查看可用的node.js版本号
nvm list available2.安装不同版本的node
nvm install 14在nvm install后面加上你要安装的版本号就可以直接下载,(例如:nvm install 14)即可安装对应版本以及自动安装对应的npm版本。
3.切换node版本
nvm use 14安装成功后,输入命令行nvm use node版本号(例如:nvm use 14)即可选择你本地所使用的Node.js版本,使用此命令行可以根据你自己的需要随意切换node.js版本运行。
切记:第一次安装好一定要输入这个命令,才能使用node。
4.查看node和npm版本号
node -v
npm -v
参考:
边栏推荐
- VS Code 设置代码自动保存
- [Yu Yue education] financial management reference materials of Ningbo University of Finance and Economics
- [datawhale202206] pytorch recommendation system: precision model deepfm & DIN
- 系统测试UI测试总结与问题(面试)
- IOS interview
- Ipv6-6to4 experiment
- [20220605] Literature Translation -- visualization in virtual reality: a systematic review
- One year anniversary of bitbear live studio, hero rally order! I invite you to take a group photo!
- QT 播放器之列表[通俗易懂]
- redis探索之缓存击穿、缓存雪崩、缓存穿透
猜你喜欢

比特熊直播间一周年,英雄集结令!邀你来合影!

How to use opcache, an optimization acceleration component of PHP

第十四章 信号(四)- 多进程任务示例
![[datawhale202206] pytorch recommendation system: multi task learning esmm & MMOE](/img/8f/64fea641730795a2b5252cc2c8cdd2.png)
[datawhale202206] pytorch recommendation system: multi task learning esmm & MMOE
![[20211129] jupyter notebook remote server configuration](/img/7c/79c9fcb91bde75e954dc3ecf9f5afd.png)
[20211129] jupyter notebook remote server configuration

MySQL common functions
![[brain opening] west tide and going to the world series](/img/b2/444af296e170d19629800b3d4c50fa.jpg)
[brain opening] west tide and going to the world series

One year anniversary of bitbear live studio, hero rally order! I invite you to take a group photo!

Chapter 14 signals (IV) - examples of multi process tasks
![[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 4](/img/4f/bc6c39ef4f2d1c4bdad8420f7badac.jpg)
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 4
随机推荐
【20211129】Jupyter Notebook遠程服務器配置
JS reverse | m3u8 data decryption of a spring and autumn network
CPI tutorial - asynchronous interface creation and use
QT 播放器之列表[通俗易懂]
Zero copy technology of MySQL
Tencent security and KPMG released a regulatory technology white paper to analyze the "3+3" hot application scenarios
【datawhale202206】pyTorch推荐系统:召回模型 DSSM&YoutubeDNN
Mysql database knowledge collation
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 4
【语音信号处理】3语音信号可视化——prosody
Tencent Li Wei: deeply cultivate "regulatory technology" to escort the steady and long-term development of the digital economy
ASTM D 3801固体塑料垂直燃烧试验
Use of easyexcel
比特熊直播间一周年,英雄集结令!邀你来合影!
6.30模拟赛总结
栈的应用——括号匹配问题
6.30 simulation summary
Compile and debug net6 source code
Switch basic experiment
Efforts at the turn of the decade