0
0

【環境構築】Reactインストールから実行まで

Last updated at Posted at 2023-12-29

はじめに

WindowsでWSL上にインストールしたので残しておきます。

事前準備

# cURLのインストール
sudo apt-get install curl

# nvmインストール
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

# インストールの確認→「nvm」と返却されることを確認
# "コマンドが見つかりません" というメッセージが返される場合または何も応答がない場合は、一度閉じて開きなおす
command -v nvm

Node.jsのインストール

# Node.js の現在の安定したLTSリリースをインストール
nvm install --lts

#最新版は「nvm install node」でインストール可能

#バージョン確認
node --version
npm --version

Reactインストール

# ディレクトリ作成
mkdir <ディレクトリ名>

# 移動
cd <ディレクトリ名>

# Reactインストール
npx create-react-app <プロジェクト名>

create-react-appをインストールしますか?と聞かれるので、「y」(yes)でインストールに進む

Need to install the following packages:
create-react-app
Ok to proceed? (y)

確認

エディタで開いてプロジェクトが存在すること確認
image.png

アプリを開始し、 http://localhost:3000/ で画面が表示されればOK

npm start

image.png

参考

Linux 用 Windows サブシステムに React をインストールする

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