惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 雪莉06

antd vue 树形表格 vue2 jeecgBoot keepalive 解决方案 vue中实现页面全屏和指定元素全屏 screenfull全屏组件的基本使用 网页导出EXCEL格式数据,长数字变为科学计数法的解决方法 dedecms织梦自定义表单导出到excel的方法 织梦dede:arclist按最新修改排序orderby=pubdate无效的解决方法 vue-router报错:Uncaught (in promise) NavigationDuplicated {_name: ‘NavigationDuplicated‘, name: ‘Navig elementUI 的 input无法输入bug解决 vue数字翻牌效果 j-modal的 slot="footer" 失效 v-if判断页脚按钮 帝国CMS后台登录空白怎么办?如何修改成https ES6两个数组进行比较 element ui form表单 表格下嵌套动态表格,新增行,删除行 vue 父子组件传值报错:this.$emit is not a function 解决 dede列表页调用二三级导航栏(转载) a-table 鼠标滑过显示小手,当前行可点击(转载) echarts折线图使用dataZoom,切换数据时渲染异常,出现竖线bug vue里面修改title样式
nvm的安装和使用(转)
雪莉06 · 2024-11-20 · via 博客园 - 雪莉06

完整配置可控版本node教程
目标:本教程通过安装 nvm for windows 可以轻松切换 node 版本。
1
** 注:请按照顺序操作!**

环境
- windows
1
提前知道的知识
- node 版本 选择LTS稳定版本
LTS 稳定版本
current 最近版本
Stable current里的稳定版本,其他不是最稳定的。
latest/ 表示latest Stable release,比LTS新一些,不建议线上使用
latest-argon/ 表示代号为argon的LTS,可以在线上使用
- 直接安装可以选择 .msi 后缀的包
- nvm 是什么?
全称:Node Version Manager,即Node版本控制管理器
- 关于nvm的其他事情
网上还有 nvmw ,同样的作者,nvmw比较早出。
之前nvm只能在OSX上使用,所以windows下使用了nvmw。
不过现在出了这个nvm for windows ,所以windows系统也能使用到nvm了。
还有一个 n 也是Node 的版本控制器,不过我们*只选择最流行的那个*。

下载 nvm 包([使用本地版本][5])
https://github.com/coreybutler/nvm-windows/releases
选择前面为`Latest release`的版本
下载后缀为 nvm-setup.zip 的安装包

运行nvm-setup.exe 并更改里面的安装路径
安装说明:

安装过程中的 nodejs 选项: 为你的node版本的快捷方式

在你使用use nodex.x.x 命令选择使用安装好的node版本后

会在nodejs目录下,创建一个node.exe快捷方式指向你指定使用的node版本对应的文件夹。

比如:
use node6.10.0

这时候会在nodejs里面创建一个快捷方式 node.exe ,它指向 node6.10.0版本,

如果你切换不同的版本,程序都是改动这里的链接,从而实现切换版本的目的

配置说明:
会自动配置系统环境变量中的Path
会自动添加以下环境变量:
NVM_HOME :指向nvm安装目录,即settings.txt中root中的值
NVM_SYMLINK :node快捷方式所在的目录,即settings.txt中path的值
Path :变量值中增加 NVM_HOME 和 NVM_SYMLINK两个环境变量

检查nvm安装成功与否
打开cmd

nvm // 会列出指示

nvm配置
打开nvm里的settings.txt

最后一行添加
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/


以上设置了node以及npm【镜像】为国内的淘宝源【镜像】

说明:

root:配置为当前nvm.exe所在目录;

  path:配置为node快捷方式所在目录;

  arch:配置为当前操作系统的位置(32/64);

  proxy:代理,一般先不用配置,如果以后下载包时被墙了可以配置淘宝的镜像;

安装和切换node版本
安装node
nvm install 6.10.0
1
指定你想要的版本node为当前的环境node,用来切换版本。
nvm use 6.10.0
// 此命令输完后便发现你所配置的node为nodejs的快捷方式
1
2
查看node
node -v // v6.1.0
1
其他命令
1. 查看nvm版本号
nvm version

2. 查看当前安装了哪些版本的node
nvm list

3. 设置nvm存放node版本的目录
nvm root=url

4. 设置node下载的镜像地址
nvm node_mirror=url

5. 设置 npm 下载的镜像地址
nvm npm_mirror=url

6. 设置代理地址
nvm proxy=url

7. 设置当前系统位数
nvm arch=32/64

指定node的全局安装目录和缓存目录(方便管理)
npm config set prefix "node安装目录\node_global"
npm config set cache "node安装目录\node_cache"

设置包源
两种方式,可以使用cnpm也可以不使用

1. 设置成cnpm(换一个淘宝出的管理其他包的软件包,功能一样,速度稍微快一点)
npm install -g cnpm --registry=https://registry.npm.taobao.org

2. 还是npm(仅仅是换一个源地址)
npm config set registry=https://registry.npm.taobao.org

使用nrm切换包源(推荐)

nom install nrm -g
nrm list
nrm use taobao
nrm list // 查看当前使用的源

我们已经安装好了nvm、node、npm,并且配置好了下载地址都是国内的淘宝源。

至此,本教程结束。
————————————————

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

原文链接:https://blog.csdn.net/junjiahuang/article/details/83243383