当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担.添加下方名片,即可获取全套学习资料哦
边栏推荐
- nacos安装配置和单机部署教程
- HCIP BGP Comprehensive Experiment Establishing peers, route reflectors, federation, route announcement and aggregation
- 如何优化OpenSumi终端性能?
- 机器学习——支持向量机原理
- APT + Transform to realize multi module Application distributed Application life cycle
- 线程基础(一)
- Practice on optimizing startup performance of VS Code
- Redis database
- 关于鸿蒙系统 JS UI 框架源码的分析
- 聪明人的游戏提高篇:第三章第二课:“桐桐数”(number)
猜你喜欢
selenium + robotframework的运行原理
使用TinkerPop框架对GDB增删改查
leetcode每天5题-Day04
金蝶国际:半年亏掉去年一年,疯狂烧钱的商业模式如何持续
Stress testing and performance analysis of node projects
APT + Transform to realize multi module Application distributed Application life cycle
APT + Transform 实现多模块应用Application生命周期分发
C语言操作符详解(2)
51 MCU Peripherals: Infrared Communication
leetcode括号匹配问题——32.最长有效括号
随机推荐
6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略
Introduction to coredns
The advantages of making web3d dynamic product display
pytorch常用函数
Differences between i++ and ++i in loops in C language
go里面的基本知识
Nacos安装详细过程
Features and installation of non-relational database MongoDB
Polar Parametrization for Vision-based Surround-View 3D Detection 论文笔记
Block elements, inline elements (
Practice on optimizing startup performance of VS Code
【漫画】2021满分程序员行为对照表(最新版)
人工神经网络
Machine learning -- - theory of support vector machine (SVM)
保证家里和企业中的WIFI安全-附AC与AP组网实验
oracle 远程连接数据库
Stress testing and performance analysis of node projects
Luogu mini game Daquan (everyone who uses Luogu must know)
DNS的解析流程
Node的安装与环境变量的配置