当前位置:网站首页>Node installation and configuration (node-v12.20.2-x64 ) and introduction to node version switching
Node installation and configuration (node-v12.20.2-x64 ) and introduction to node version switching
2022-08-02 06:44:00 【m0_67392931】
一、node的安装(You can go to the end of the article to install directlynvm管理器,就不用配置了)
1 下载 | Node.js,Previous versions can also be downloaded,window是以msi结尾的文件
2 安装,Just keep installing it,If there is a previously installed version,先进行卸载,然后再进行安装
3 安装完成后查看版本号
node -v
npm -v
4 Configure the installation location of global packages
5 在cmdThe console runs the following two commands, The addresses in the double quotation marks are changed to the addresses in the two folders just now
npm config set prefix "D:Program Files
odejs
ode_global"
npm config set cache "D:Program Files
odejs
ode_cache"
6 然后配置环境变量 “我的电脑”-右键-“属性”-“高级系统设置”-“高级”-“环境变量”
7 在"系统变量"下新建**“NODE_PATH”**,
输入"D:Program Files odejs ode_global" ,就是The address of the newly created folder
7 然后将"用户变量"下的**“Path"修改为"D:Program Files odejs ode_global”**,Also the folder address
二、前端node常用包安装、常用命令
查看npm镜像源
npm get registry
配置npm淘宝镜像源
npm config set registry https://registry.npm.taobao.org
恢复npm默认镜像源
npm config set registry https://registry.npmjs.org
安装cnpm
npm install cnpm --registry=https://registry.npm.taobao.org -g
安装yarn
npm install yarn -g
查看yarn镜像源
yarn config get registry
配置yarn淘宝镜像源
yarn config set registry https://registry.npm.taobao.org
恢复yarn默认镜像源
yarn config set registry https://registry.yarnpkg.com
安装webpack
npm install webpack webpack-cli -g
安装vue脚手架
npm install @vue/cli -g
安装vite(Vite 需要Node.js版本 >= 12.0.0.)
npm install create-vite-app -g
安装react
npm install create-react-app -g
安装全局nodemon
npm install nodemon -g
安装全局express
npm install express-generator -g
安装koa
npm install koa-generator -g
安装eggJS
npm install egg-init -g
安装nestJS
npm install @nestjs/cli -g
安装TypeScript
npm install typescript -g
安装Electron
npm install electron -g
安装TypeORM
npm install typeorm -g
npm清理缓存
npm cache clean -f
node查看npm包的位置
npm config get prefix
三、node的版本切换(建议安装nvm,非常好用)
一、直接切换
则只需要去node官网下载你需要的版本,Then install it directly and overwrite the original one,什么都不用配置
二、经常切换,NVMOne command switches versions directly
安装node的版本控制器NVM,直接下载安装就行,我现在都用nvm配置node,There is no need to configure environment variables,Global for each versionnpmPackages are not shared,各自独有
安装方法网上有很多,You can find detailed installation methods directly on Baidu,They say uninstall the original one first,Now it seems to be able to install without uninstalling,I installed it directly,Then you can use it directly,挺好用的,One command switches versions directly
nvm下载地址在github上,下载比较慢,Installation is only required to select the installation location,其他正常安装
三、nvm常用命令
配置下载源
nvm node_mirror https://npm.taobao.org/mirrors/node/
nvm npm_mirror https://npm.taobao.org/mirrors/npm/
查看所有可以安装的node版本
nvm list available
After switching versions, it is not easy to report errors after clearing the cache and then operating,Use in administrator modenvm切换命令
//查看已经安装的版本
nvm ls
nvm list
//下载某个版本,例如9.0.0版本
nvm install 9.0.0
//切换版本,例如切换到9.0.0 , Recommended for administratorscmd窗口运行命令,不然会报错
nvm use 9.0.0
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在.深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小.自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前.因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担.添加下方名片,即可获取全套学习资料哦
边栏推荐
- NPM ---- 安装yarn
- 5款经典代码阅读器的使用方案对比
- Integrate ssm (1)
- leetcode括号匹配问题——32.最长有效括号
- 25K test old bird's 6-year experience in interviews, four types of companies, four types of questions...
- Luogu mini game Daquan (everyone who uses Luogu must know)
- MySQL经典50道练习题及全网最详细解析
- 引领需求 为HR价值正名——“人力资源领先模型HRLM”成功首发
- HCIP BGP综合实验 建立对等体、路由反射器、联邦、路由宣告及聚合
- 51 MCU peripherals: ADC
猜你喜欢
Block elements, inline elements (
elements, span elements)【漫画】2021满分程序员行为对照表(最新版)
Polar Parametrization for Vision-based Surround-View 3D Detection Paper Notes
eggjs controller层调用controller层解决方案
虚拟现实房产展示系统提前预见未来装修效果
Nacos database configuration
Deep learning - CNN realizes the recognition of MNIST handwritten digits
[Cartoon] 2021 full score programmer behavior comparison table (latest version)
家用 NAS 服务器(4)| MergerFS和SnapRaid数据定时备份
HCIP BGP综合实验 建立对等体、路由反射器、联邦、路由宣告及聚合
随机推荐
mysql索引失效的常见9种原因详解
股价屡创新低 地产SaaS巨头陷入困境 明源云该如何转型自救?
APT + Transform 实现多模块应用Application生命周期分发
Difference and analysis of CPU usage and load
Cyber Security Learning - Intranet Penetration 4
C 竞赛——捕鱼
5款经典代码阅读器的使用方案对比
Alluxio为Presto赋能跨云的自助服务能力
直播系统聊天技术(八):vivo直播系统中IM消息模块的架构实践
Write implicit join on view with jOOQ 3.14 synthetic foreign key
51 MCU Peripherals: Infrared Communication
leetcode一步解决链表反转问题
Redis database
如何优化OpenSumi终端性能?
科技赋能拉萨之“肺”,华为助力拉鲁湿地智慧管理守护绿水青山
selenium + robotframework的运行原理
BGP实验(路由反射器,联邦,路由优化)
Luogu mini game Daquan (everyone who uses Luogu must know)
NPM 安装指定版本包的方法及版本号查看
Automated operation and maintenance tools - ansible, overview, installation, module introduction