LoginSignup
29
19

More than 5 years have passed since last update.

Ubuntu に npm をインストールする

Last updated at Posted at 2017-09-01

Ubuntu 14.04 にnpmをインストールしようとしたところ、時間を要したので情報を整理しておく。

以下のコマンドを実行したところエラーになった。

sudo apt-get install nodejs

マニュアルInstalling Node.js via package managerにはUbuntuに導入する手順が記載されている。その手順に従う。

まずインストールに失敗した nodejs を削除する。

sudo apt-get remove --purge nodejs

次にマニュアルに記載された手順に従う。

sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

その後、最新のnpmをインストールする

sudo npm install npm@latest -g

以上。

29
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
19