0
0

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 1 year has passed since last update.

WindowsからMacに開発環境を移行する

Last updated at Posted at 2022-10-09

はじめに

WindowsPCの動作が重かったため、MacPCを購入して開発をすることにした。
新しいMacPCで開発環境を構築するにあたり実施したことを記録する。

環境

Windows10からMacbookpro MacOS Catalina 10.15.7に開発環境を変更した。

1.TypeScriptの環境構築を行う

以下の記事を参考にTypeScriptの環境構築を行った。
トラハック github

1.homebrewのインストール

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2.nodebrewのインストール

brew install nodebrew


/usr/local/opt/nodebrew/bin/nodebrew setup_dirs

echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bash_profile

3.nodeの安定バージョンをインストール

nodebrew install stable

4.nodebrewのバージョン一覧を確認

nodebrew ls

5.インストールしたバージョンを指定して切り替える

nodebrew use v18.10.0

6.nodeのパスを通す

echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.zshrc

7.ターミナルの再起動
8.nodeとnpmのバージョン確認

node -v
npm -v

2.GoとVScodeをインストール

1.以下のサイトに従ってGoとVSCodeをダウンロード
Go 開発用に Visual Studio Code を構成する
2.VSCodeダウンロード後、VSCodeのGo拡張機能を設定

Dockerのインストール

以下のサイトでインストール、私のmacはintelチップだったのでintel
チップ版をダウンロード。
Mac に Docker デスクトップをインストールする

gitを設定する

1.gitはmacにインストールされていたので、以下のサイトの「3.gitの初期設定」から実施
【Mac】Gitの環境構築をしよう!
「4. GitHubの設定」はアカウントを作成ずみだったので飛ばし、SSH Keyを作成した。
GitHub アカウントへSSHキーを追加したのち、既存のリモートリポジトリからリポジトリをクローンした。
【Git入門】git cloneで既存リポジトリをクローンしよう!

既存のリポジトリをクローンしたのち、動作確認のため新規にブランチを生成した

VSCodeに拡張機能を追加

ESLint,Prettierをインストール

動作確認

WindowsからMacに移行したため、前回と同様に動作するか確認した。
1.フロントの確認
npm upgrade を実施してnodeのパッケージをインストール。
npm run devを実施、開発途中のアプリケーションが起動することを確認。

2.バックエンドの確認
docker起動する確認
docker-compose build
docker-compose up -d

感想

Dockerの便利さを認識した。
Dockerfileを作成すれば新しいPCにも即座に環境を構築してアプリケーションを起動させることができる。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?