5
2

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 3 years have passed since last update.

M1 MacにVue CLIを導入する

Last updated at Posted at 2021-04-23

はじめに

M1 Mac にVue CLIを導入した時のメモ。
nvmやnodeの導入も初めて。

手順

nvmをインストール。

% brew install nvm

何か言われるので、

Please note that upstream has asked us to make explicit managing
nvm via Homebrew is unsupported by them and you should check any
problems against the standard nvm install method prior to reporting.

You should create NVM's working directory if it doesn't exist:

  mkdir ~/.nvm

Add the following to ~/.zshrc or your desired shell
configuration file:

  export NVM_DIR="$HOME/.nvm"
  [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

You can set $NVM_DIR to any location, but leaving it unchanged from
/opt/homebrew/opt/nvm will destroy any nvm-installed Node installations
upon upgrade/reinstall.

言われた通りにディレクトリ作成してnvmにパスを通す。

% mkdir ~/.nvm
% open ~/.zshrc
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

ファイルの変更を適用。

% source ~/.zshrc  

パス開通確認。

% nvm version
v16.0.0

登録されているNode.jsバージョンの確認。

% nvm ls-remote
...
       v15.13.0
       v15.14.0
        v16.0.0

最新をインストール。

% nvm i v16.0.0

v16.0.0は2021/4/20にリリース(この記事の3日前)。
このバージョンからM1に正式に対応したらしい。
ちょっと嬉しい。

インストール内容の確認。

% node -v
v16.0.0

% node -p process.arch
arm64

% nvm current
v16.0.0

% npm -v
7.10.0

vue CLIのインストール。

% npm install -g @vue/cli

インストール内容の確認。

% vue --version
@vue/cli 4.5.12
5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?