代码版本一直升级,需要升级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:
- Install NVM: Follow the instructions here.
- Install Your Desired Version: Run
nvm install <version>
. - 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:文章来源:https://www.toymoban.com/news/detail-795325.html
$ nvm install 16
v16.20.2 is already installed.
Now using node v16.20.2 (npm v8.19.4)
$ node -v
v16.20.2
重启系统可以啦~文章来源地址https://www.toymoban.com/news/detail-795325.html
到了这里,关于Ubuntu 上升级nodejs 版本的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!