我正在尝试在Amazon linux
计算机上安装Nodejs
,我正在按照此文档安装节点https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html,但在执行此命令nvm install node
时出现以下错误
我如何解决这个问题?任何帮助将不胜感激。谢谢!
v18.0.0 is already installed.
node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `nvm use --delete-prefix v18.0.0` to unset it.
[ec2-user@ip-xx-xxx-xx-xx ~]$ node -e "console.log('Running Node.js ' + process.version)"
-bash: node: command not found
我试着运行这个nvm use --delete-prefix v18.0.0
,但没有运气。
2条答案
按热度按时间sqserrrh1#
按照示例,尝试安装active LTS version,而不是最新的
nvm install 16
(而不是nvm install node
)。这在docker映像amazonlinux:2上进行了测试,并与AWS CDK支持的内容相关联(参考)
jdgnovmf2#
Amazon Linux 2或某些操作系统包含glibc 2.26或更低版本,如果要使用更高的glib版本,则需要考虑其他AMI.例如)Amazon Linux 2022.(al 2022-ami)它包含glibc 2.34
参考:https://repost.aws/questions/QUrXOioL46RcCnFGyELJWKLw/glibc-2-27-on-amazon-linux-2