我是靠谱客的博主 威武眼神,这篇文章主要介绍linux使用yum安装nodejs,现在分享给大家,希望可以做个参考。

1、安装源

curl -sL https://rpm.nodesource.com/setup_12.x | bash -

2、开始安装

yum -y install nodejs

3、node -v  和npm -v 查看版本,说明安装成功

4、替换为淘宝npm镜像

首先我们可以查看原本的镜像地址:

npm get registry
https://registry.npmjs.org/

5、替换成淘宝的:

npm config set registry http://registry.npm.taobao.org/

如果想恢复原来的镜像地址:npm config set registry https://registry.npmjs.org/

如果用淘宝定制的cnpm工具来代替默认的npm:npm install -g cnpm --registry=https://registry.npm.taobao.org

 

 

最后

以上就是威武眼神最近收集整理的关于linux使用yum安装nodejs的全部内容,更多相关linux使用yum安装nodejs内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(57)

评论列表共有 0 条评论

立即
投稿
返回
顶部