LoginSignup
0
1

More than 1 year has passed since last update.

Reactの環境構築 by create-react-app

Posted at

はじめに

これは、create-react-appの環境を構築したときのメモ。
自分のメモ用なので、見ないでくださいorz~~~。

nodeをinstall

ここから自分のOSのアイコンを押してinstallする。

コマンドプロンプトを開く

  1. Windows + R
  2. cmdと入力
  3. Ctrl + Shift + Enter
  4. Alt + y

以下はコマンドプロンプト上での作業

node, npmの確認

下記のコマンドでバージョンが表示されればO.K.

node -v
npm -v

yarnのinstall

npmは遅くて脆弱性があるらしいので、その改良版みたいなyarnを用いる方が良いらしい。

npm install -global yarn

yarnのパス指定

パスが通っていれば必要なし。
以下のコマンドで得たパスを通す。環境変数を変更した後は、再起動した方が良いかも。

yarn global bin

create-react-appのinstall

yarn global add create-react-app

create-react-appの確認

下記のコマンドでバージョンが表示されればO.K.

create-react-app -v

プロジェクトディレクトリに移動

cd [プロジェクトを入れるフォルダ]

プロジェクトの作成

今回は my_app というプロジェクトを作成する。お好きな名前でどうぞ。因みに大文字の名前は不可だった。

create-react-app my_app

プロジェクトに移動

cd my_app

プロジェクトを開始

以下のコマンドを入力しブラウザが立ち上がりreactのマークが表示されれば完了!

yarn start

参考文献

コマンド(2022/01/08)
* https://qiita.com/rubytomato@github/items/1696530bb9fd59aa28d8

パス(2022/01/08)
* https://kantaro-cgi.com/blog/nodejs/npm_and_yarn_global_install_path.html

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