LoginSignup
0
0

More than 5 years have passed since last update.

AmazonLinux (Docker)にNode.js & npmをインストールする。

Posted at

AmazonLinuxにNode.jsとnpmをインストールします。

■ 動作環境

■ 事前準備

  • AmazonLinuxのDocker imagesをpullします。
$ docker pull amazonlinux:latest
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
amazonlinux         latest              d656eea421ba        7 days ago          162MB

$ docker run -itd amazonlinux
$ docker ps -a --format "table {{.ID}} {{.Image}}"
CONTAINER ID IMAGE
8c128ef6eb5a amazonlinux
$ docker attach 8c128ef6eb5a
bash-4.2#

■ Node.js & npm インストール

Installing Node.js via package manager
の手順を参考にインストールしていきます。

AmazonLinuxは、Enterprise Linux and Fedoraの部分を参考にします。

On RHEL, CentOS or Fedora, for Node.js v8 LTS:

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -

Then install:

sudo yum -y install nodejs

※sudoが使えない場合は、yum install -y sudoでインストールしてください。

完了です。
きちんとインストールされたか確認していきましょう。

$ node --version
v8.12.0
$ npm --version
6.4.1

以上です。

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