当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担.添加下方名片,即可获取全套学习资料哦
边栏推荐
- Smart people's game improvement: Chapter 3, Lesson 2: "Number of Tongtong" (number)
- What are the ways to improve software testing capabilities?After reading this article, it will take you up a notch
- 6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略
- APT + Transform to realize multi module Application distributed Application life cycle
- The virtual reality real estate display system foresees the future decoration effect in advance
- 深度学习——CNN实现MNIST手写数字的识别
- npm 和 yarn的区别
- Introduction to coredns
- 线程基础(一)
- 触发器简单解释
猜你喜欢

leetcode每天5题-Day04

Practice on optimizing startup performance of VS Code

虚拟现实房产展示系统提前预见未来装修效果

家用 NAS 服务器(4)| MergerFS和SnapRaid数据定时备份

25K test old bird's 6-year experience in interviews, four types of companies, four types of questions...

leetcode-318.最大单词长度乘积

Meta公司内部项目-RaptorX:将Presto性能提升10倍

The installation of NPM, CNPM

深度学习——CNN实现MNIST手写数字的识别

股价屡创新低 地产SaaS巨头陷入困境 明源云该如何转型自救?
随机推荐
flex布局(弹性布局)
金蝶国际:半年亏掉去年一年,疯狂烧钱的商业模式如何持续
Features and installation of non-relational database MongoDB
Polar Parametrization for Vision-based Surround-View 3D Detection 论文笔记
51 microcontroller peripherals article: dot-matrix LCD
Not annotated parameter overrides @NonNullApi parameter
npm、cnpm的安装
MarkDown Formula Instruction Manual
双重for循环案例(用js打印九九乘法表)
A list of 300+ learning resources compiled by senior engineers of the Tao Department (the latest version in 2021)
HCIP第十七天
leetcode solves the linked list merge problem in one step
股价屡创新低 地产SaaS巨头陷入困境 明源云该如何转型自救?
Redis(十二) - Redis消息队列
go里面的基本知识
Meta公司内部项目-RaptorX:将Presto性能提升10倍
About the directory structure of the web application
5款经典代码阅读器的使用方案对比
C# 编码规范手册
leetcode-338.比特位计数