1
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始めるメモ

Last updated at Posted at 2019-06-02

後から手順起こしたりしてるので漏れなどあるかも。

環境/ツール

  • Mac OS X Mojava 10.14.5
  • anyenv 1.1.0
  • nodenv 1.3.0
  • node 11.1.0
  • npm 6.9.0
  • yarn 1.15.2

環境構築

anyenv

$ brew install anyenv 
$ echo 'eval "$(anyenv init -)"' >> ~/.bash_profile
$ exec $SHELL -l
$ anyenv --version
anyenv 1.1.0
$ anyenv install -l

nodenv

$ anyenv install nodenv
$ exec $SHELL -l
$ anyenv versions
$ which nodenv
/usr/local/anyenv/envs/nodenv/bin/nodenv
$ nodenv --version
nodenv 1.3.0

元々ndenvを入れようとしていたけど、古くてもう非推奨らしい

node

$ nodenv install 11.1.0
$ nodenv global 11.1.0
$ nodenv version
11.1.0 (set by /usr/local/anyenv/envs/nodenv/version)
$ which npm
/usr/local/anyenv/envs/nodenv/shims/npm
$ npm --version
6.9.0

React&Typescriptの準備

$ npx create-react-app hello-world --typescript
$ npm start

ブラウザが起動してサンプル画面が出るはず。
既存のnodeとかがあるとnode_modulesとかがコンフリクトしたりするので初期化する必要あり。

参考

圧倒的感謝!!

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