LoginSignup
9
9

More than 5 years have passed since last update.

Raspberry Piに最新版Node.jsをダウンロード

Last updated at Posted at 2016-02-12

Raspberry Piに最新版のNode.jsをダウンロードしようと思ったのですが、配布先が様々あり迷いました。

ssh
$  sudo apt-get install nodejs

これでインストールはされるものの、バージョンが少し古いものしかダウンロード出来ません。どうせ使うならv4.0以降の安定版を入れたいと思いました。

公式ページからダウンロード

nodejs.orgよりバージョンを指定してRaspberry Piにダウンロードする方法が海外記事に書かれていました。

Installing Node.js v4.0.0 on a Raspberry Pi (All Models)

以下引用です。

Download Node.js source
Raspberry Pi Model A, B, B+ and Compute Module
wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv6l.tar.gz
tar -xvf node-v4.0.0-linux-armv6l.tar.gz
cd node-v4.0.0-linux-armv6l

Raspberry Pi 2 Model B
wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv7l.tar.gz
tar -xvf node-v4.0.0-linux-armv7l.tar.gz
cd node-v4.0.0-linux-armv7l

ダウンロード先はこの様なファイルになっていました。

1.png

Raspberry Pi 2 Model B ならば node-v4.0.0-linux-armv7l.tar.gzをダウンロード後解凍すれば良い様です。

やってみた

Macに入れたものと同じバージョンで揃えたかったのでv4.2.4を選びダウンロード。

ssh
$ wget https://nodejs.org/dist/v4.2.4/node-v4.2.4-linux-armv7l.tar.gz

解凍しました。(数分で解凍出来ました)

ssh
$ tar -xvf node-v4.2.4-linux-armv7l.tar.gz

ディレクトリに移動してユーザーローカルにコピーします。

ssh
$ cd node-v4.2.4-linux-armv7l

 ~/node-v4.2.4-linux-armv7l $ sudo cp -R * /usr/local/

2.png

/user/local フォルダにコピーされました。

ssh
$ node -v
v4.2.4

無事ダウンロード成功。ホッ。

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