LoginSignup
0
0

More than 1 year has passed since last update.

PowerShell で nodenv + yarn 環境を構築する

Posted at

1. PowerShellを立ち上げ、Bashを起動する

$ bash

2. nodenvをgit cloneする

$ git clone https://github.com/nodenv/nodenv.git ~/.nodenv

3. Nodenvの初期設定

Nodenvをクローン後、コンパイル

cd ~/.nodenv && src/configure && make -C src

コンパイラが存在しないと怒られた

# エラーメッセージ
  > checking for C compiler ... not found
  > ./configure: error: C compiler cc is not found

gccをインストール

$ apt install gcc

再度実行

$ cd ~/.nodenv && src/configure && make -C src

4. nodenvの初期設定を追加

$ echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(nodenv init -)"' >> ~/.bash_profile
$ exec $SHELL -l

5. nodenvにバージョンを追加

$ git -C ~/.nodenv/plugins/node-build pull

6. Nodenvで設定したいNodeのバージョンをインストール、環境全体に適用

$ nodenv install 18.6.0
$ nodenv global 18.6.0

7. Yarnをインストール

$ npm install --global yarn 

8. 確認

立ち上がりました

$ yarn -v
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