0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

React.jsの環境構築

Last updated at Posted at 2019-03-30

こんにちは@yukifreeworld12です。

Reactの環境構築は10〜15分あれば出来るので思ったより簡単でした。

node.jsのインストール

公式サイト node.js
注 Homebrewがインストールされている程で進めていきます。
brew install node
バージョンの切り替えツールのインストール
npm install -g n
バージョンのインストール
n 8.12.0
   ↑
ここでError: sudo requiredというエラーが出た場合
sudo mkdir /usr/local/nでディレクトリを作り再びTRY!
自分の場合正しいのか少し不安ですがsudo n 8.12.0で進めてしまいましたがそれでも出来ました。

ディレクトリにroot権限を与える
sudo chown -R $(whoami) /usr/local/n
インストールとバージョン確認
n 8.12.0
node -v

JSのパッケージマネージャyarnのインストール

brew install yarn --without-node
ここでError: invalid option: --without-nodeというエラーが出た場合
brew install yarn --ignore-dependenciesとしてTRY!
インストールの確認
yarn --vesion
バージョンが確認できればOKです。

webpack4インストール

webpackとライブラリなどのインストール
yarn add --dev webpack webpack-cli

これでReact.jsの開発環境が整いました。

最後に

今日も見てくれてホンマありがとな!!
記事がええなと思ったらフォローといいねホンマよろしくな!!
(ジョーブログ風に)

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?