无法在Linux机器上安装Node.JS

时间:2020-04-01 11:03:15

标签: node.js linux

我正在努力在Linux机器上安装Node.JS。 运行brew install node时,得到此输出

```[c_test@whatever-server ~]$ brew install node
==> Installing dependencies for curl: glibc, gcc, pkg-config and openssl@1.1
==> Installing curl dependency: glibc
==> Downloading https://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.gz
Updating Homebrew...
######################################################################## 100.0%
==> ../configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=/home/c_test/.linuxbrew/Cellar/glibc/2.23 --enable-obsolete-rpc --without-selinux --with-binutils=/home/c_
Last 15 lines from /home/c_test/.cache/Homebrew/Logs/glibc/01.configure:
checking version of gmake... 3.81, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.17, ok
checking for makeinfo... no
checking for sed... sed
checking version of sed... 4.2.1, ok
checking for gawk... gawk
checking version of gawk... 3.1.7, ok
checking if gcc -B/home/c_test/.linuxbrew/opt/binutils/bin/ is sufficient to build libc... no
checking for nm... nm
configure: error: 
*** These critical programs are missing or too old: compiler
*** Check the INSTALL file for required versions.

READ THIS: https://docs.brew.sh/Troubleshooting```

我想gcc版本是个不错的版本:

gcc (GCC) 8.4.0
Copyright (C) 2018 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.

当我尝试从源代码构建它时,我遇到类似的错误:

./configure
WARNING: C++ compiler (CXX=g++, 4.4.7) too old, need g++ 6.3.0 or clang++ 8.0.0
ERROR: Did not find a new enough assembler, install one or build with
       --openssl-no-asm.
       Please refer to BUILDING.md

1 个答案:

答案 0 :(得分:0)

是的,您的编译器已过期。

Nodesource有一个非常简单的安装程序安装程序,它可以根据您的系统和体系结构自动检查Node js。使用apt / apt-get通常也会更新依赖关系(例如gcc,g ++):

请参见https://github.com/nodesource/distributions和最新的

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_13.x | bash -
apt-get install -y nodejs
相关问题