簡體   English   中英

無法在 Linux 機器上安裝 Node.JS

[英]Can't install Node.JS on linux machine

我正在努力在 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

你是對的,你的編譯器已經過時了。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM