在Debian LAMP上安裝Node.js,可采用以下兩種常見方法:
sudo apt update
。curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
。sudo apt install -y nodejs
。node -v
和npm -v
,若顯示版本號,則安裝成功。curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
。source ~/.bashrc
(若使用Bash)。nvm install --lts
。nvm use --lts
。node -v
和npm -v
。