기타정보

[정보] nodejs 20 버전 ubnutu에 설치하기

TwoIceFish 2023. 11. 30. 15:35

 

 

명령어 설치

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
sudo apt-get install -y nodejs

https://deb.nodesource.com/

 

 

Nodesource Node.js DEB

Welcome to Node.js DEB repository This repository distributes the DEB packages for Node.js binaries for a comprehensive "How To Install" guide, we invite you to visit our GitHub repository Distributions

deb.nodesource.com

 

 

 

nvm으로 설치

Remove old nodejs and npm if installed:

  1. sudo apt remove -y npm
  2. sudo apt remove -y nodejs

Create .bashrc if it does not exists. For me there was only the .zshrc by default on Parrot OS.

  1. touch ~/.bashrc

Get nvm via curl:

  1. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
  2. source ~/.bashrc

Install Node with nvm:

  1. nvm install node (installs the latest stable version)

Check if you have the version you like. Type nvm if you wanna see how to install or switch to other versions.

  1. node --version

Now run your ng command again to check if it work

 

 

Parrot OS comes with node version 12.0 by default, but I could not install the latest nodejs package

sudo apt-get install -y nodejs Reading package lists... Done Building dependency tree... Done Reading state information... Done nodejs is already the newest version (12.22.12~dfsg-1~deb11u3). Sinc...

stackoverflow.com