LoginSignup
8
9

More than 5 years have passed since last update.

Yarn、Node.js 4系 or 8系 をインストールする

Last updated at Posted at 2018-02-02

Railsプロジェクトに「AdminLTE」が「Yarn」を使って入れられるようになった模様。

ここではその最初のステップである「Yarn」と「Node.js」のインストール方法を覚書きします。

※「Yarn」から「AdminLTE」を入れるには、別途「Node.js」が必要になります。

実行環境

$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

実行環境は「CentOS 7系」です。

Yarnのインストール

$ sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
$ sudo yum install yarn

公式ドキュメントを参照。

Node.js 4系の場合

$ sudo rpm -Uvh https://rpm.nodesource.com/pub_4.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm
$ sudo yum install nodejs
$ node -v
v4.8.5

Node.js 8系の場合

$ cd /etc/yum.repo.d # インストール場所はとりあえずここで
$ curl -O https://rpm.nodesource.com/pub_8.x/el/6/x86_64/nodejs-8.4.0-1nodesource.el6.x86_64.rpm
$ rpm -ivhU nodejs-8.4.0-1nodesource.el6.x86_64.rpm
$ node -v
v8.4.0

メモ

最新のYarnはNode.jsのバージョンが「4.0」以上でなければ動かないようです。

$ yarn --version
Node version 0.10.48 is not supported, please use Node.js 4.0 or higher.

参考記事

CentOS 6.xにLTS(4.3.0)のnode.jsをインストールする - Qiita
setup_8 not works for CentOS6 #517 - GitHub

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