AmazonLinux Node.js 설치 시 오류 - "no package provides redhat-release "

Bloomin·2023년 4월 28일

JavaScript

목록 보기
2/3

Amazon Image에 Node.js 설치 시 다음과 같은 오류가 떴다.

$ curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash -

## Installing the NodeSource Node.js 18.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release
+ uname -m

## You don't appear to be running a supported version of Enterprise Linux. Please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your architecture to be considered for support. Include your 'distribution package' name: no package provides redhat-release
no package provides centos-release
no package provides cloudlinux-release
no package provides sl-release
no package provides fedora-release.

해결법

다음을 실행하면 됨
1.Node.js 설치

$ set -xe && curl --silent --location https://rpm.nodesource.com/setup_16.x | bash -
  • set -xe : 스크립트를 실행하는 동안 발생하는 모든 명령의 출력 표시
  • --silent : 출력이 표시되지 않도록 함
  • --location : 지정된 url에서 데이터를 다운로드 함
  • | bash - : URL에서 bash 스크립트를 다운로드하여 실행
  1. Node.js 패키지 설치
$ sudo yum -y install nodejs

1,2번 과정의 의미

1번 과정은, Node.js를 시스템에 설치하기 위한 레파지토리 저장소를 설정하는 스크립트. 이 스크립트를 실행하면 시스템에 Node.js를 설치할 수 있는 저장소가 추가됨

Node.js를 실제로 설치하려면 'yum'이나 'apt-get'과 같은 패키지 매니저를 사용하여 Node.js 패키지를 설치해야 함. 저장소를 설정하는 스크립트를 실행한 후, yum install nodejsapt-get install nodejs와 같은 명령을 사용하여 Node.js 패키지를 설치할 수 있음

따라서, Node.js를 설치하려면 먼저 저장소를 설정하고, 그 다음에 패키지 매니저를 사용하여 Node.js 패키지를 설치해야 함

[출처] https://github.com/nodesource/distributions/issues/1524

profile
기록하는 습관

0개의 댓글