01-Centos7 Node12环境配置

各个版本NodeJs环境配置

1.Centos7 + Node v12 nodejs12需gcc++6.3.0以上

# 如需安装gcc, 步骤如下centos升级g++7.3.0
sudo yum install centos-release-scl
sudo yum install devtoolset-7
scl enable devtoolset-7 bash
# 查看一下版本,可以看到版本已经是 7.3系列了
$ gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 为了避免每次手动生效,可以在.bashrc中设置:
$ source /opt/rh/devtoolset-7/enable
# or
$ source scl_source enable devtoolset-7

Node安装

# yum方式安装参考 https://github.com/nodesource/distributions
# 步骤1, root权限下运行
curl -sL https://rpm.nodesource.com/setup_12.x | bash -
# 步骤2, sudo yum install -y nodejs
sudo yum install -y nodejs

yum方式如果不能安装,建议手动编译

# 选择自己合适的源下https://npm.taobao.org/mirrors/node/各种版本
# 我这里下载了源码包https://npm.taobao.org/mirrors/node/v12.6.0/node-v12.6.0.tar.gz

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值