nodejs is already the newest version (12.22.9~dfsg-1ubuntu3).
2022. 9. 5. 18:02ㆍ웹개발
우분투에서 설치할 수 있는 최신 노드 버전이 12.22.9인데 리액트를 같이 쓰려고 보니 에러가 많이난다.
리액트는 14 이후부터 쓸 수 있다고 한다. 방법이 없다면 강제로 설치해야 하는 상황.
// 아래는 시도한건데 curl 중간에 끊겨서 비추
$ cd /etc/apt/sources.list.d
$ sudo rm nodesource.list
$ sudo apt --fix-broken install
$ sudo apt update
$ sudo apt remove nodejs
$ sudo apt remove nodejs-doc
$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
$ sudo apt-get install -y nodejs
위에까지 했는데도 노드 설치가 안되었다.
deb파일 하나씩 다 받아서 추가하는것도 오프라인도 아닌데 굳이 해야하나 싶어서 다시 구글링.
Broken pipe가 에러의 원인이었다.
The following packages were automatically installed and are no longer required:
...
Use 'sudo apt autoremove' to remove them.
...
dpkg: error processing archive /var/cache/apt/archives/nodejs_14.20.0-deb-1nodesource1_amd64.deb (--unpack):
trying to overwrite '/usr/include/node/common.gypi', which is also in package libnode-dev 12.22.9~dfsg-1ubuntu3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/nodejs_14.20.0-deb-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo apt autoremove
$ sudo apt update
$ sudo apt install nodejs
$ node -v
v14.20.0
이유는 모르겠는데 14.20으로 잘 설치되었다. 삼주동안 뭔 일이 일어난건지...
우분투 업데이트 전과 후가 섞여서 생긴 에러인가보다. 아무튼 해결
끝.
728x90
'웹개발' 카테고리의 다른 글
Error: listen EADDRINUSE (LIN/WIN) (0) | 2022.09.13 |
---|---|
pm2 tar로 설치 (1) | 2022.09.13 |
linux zip gzip 파일 압축 및 해제 (0) | 2022.09.05 |
AWS EC2 기초 세팅_Ubuntu online (0) | 2022.08.08 |
AWS EC2 생성 및 연결 확인_Ubuntu (0) | 2022.08.08 |