LoginSignup
3
3

More than 5 years have passed since last update.

Ubuntuにnode.jsをインストールするときにcommand not found: nodeと言われないようにするために

Posted at

scleen_x_xさんがおっしゃっておられたので
自分がnode.jsをUbuntuにインストールする際にやること。

実はnodejs.orgに書いてある

実は、Ubuntuインストール時にnodejsってパッケージで既に登録されているのでついついそれを使ってしまいがちなのですが。
自分も以前に素のUbuntuでapt-getでインストールしたときにscleen_x_xさんと同じく、あれ?となった一人なのです。

node.jsのサイトを見てみると。
node.jsトップ → Downloads → Installing from package managers
と進むことで、node.jsをパッケージシステムへ追加する方法が書かれています。
曰く、

curl -sL https://deb.nodesource.com/setup | sudo bash -

これを実行することでUbuntuのaptにnode.jsのリポジトリが登録されるようです。
この状態にして、

sudo apt-get install -y nodejs

を行うと、ちゃんと nodejs -> node のリンクが張られた状態でインストールされます。

3
3
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
3
3