Ubuntu 上升级nodejs 版本

代码版本一直升级,需要升级nodejs的版本

收到的错误信息:

ActionView::Template::Error (Your nodejs binary failed to load autoprefixer script file,
please check if you're running a supported version (10, 12, 14+)

开整,查看我当前的node版本

$ node -v
v8.10.0

删掉旧版本

sudo apt-get remove nodejs

项目里面用到的是node v18, 咱也准备升级到v18, 网上找了一圈,发现在linux上升级用NVM(Node Version Manager)最方便,

按照这个整:

Using Node Version Manager (NVM)

NVM is like a magic wand for managing Node.js versions. Here's how to use it:

  1. Install NVM: Follow the instructions here.
  2. Install Your Desired Version: Run nvm install <version>.
  3. Switch to the New Version: Use nvm use <version>.

Voila! You've updated Node.js.

当我安装V18的时候出现这个错误

because I can't install v18 with this error "node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)"

这个是因为我用的ubuntu版本是18,

Node 18+ is incompatible with Ubuntu 18, you can read much more about it here, that's not really something within our control at all.

我只能安装node v16:

$  nvm install 16
v16.20.2 is already installed.
Now using node v16.20.2 (npm v8.19.4)
$ node -v
v16.20.2

重启系统可以啦~

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值