Quantcast
Channel: Node.jsタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 9360

【M1 Mac】nodebrew v1.1.0が公式にAppleSiliconに対応したのでNode v16.0.0をインストール

$
0
0
はじめに M1 Mac nodebrewが公式にAppleSiliconに対応したらしい(2021-04-23) https://github.com/hokaccha/nodebrew/blob/master/History.md#110---2021-04-23 遭遇したエラー 以下のコマンドで簡単にNodeがインストールできるということで、実行してみたところ $ nodebrew install v16.0.0 なんかたくさんエラーでてる〜〜!!! 対応したちゃうんか〜!!!😂 Fetching: https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz Warning: Failed to create the file Warning: /Users/merarli/.nodebrew/src/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz: Warning: No such file or directory curl: (23) Failed writing body (0 != 978) download failed: https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz 理由はわかりませんが、Homebrew経由でnodebrewをインストールしたのが原因っぽい nodebrew インストール Homebrew経由でインストールのが悪いのかと思って、homebrewでインストールしたnodebrewをアンインストール後、 $ brew rm nodebrew 公式のGitHubに書いてあるcurlインストールのやり方でインストール https://github.com/hokaccha/nodebrew 初めてインストールする人はここから始めてください $ curl -L git.io/nodebrew | perl - setup インストール完了後 以下のパスを~./zshrcの下部に記述してください export PATH=$HOME/.nodebrew/current/bin:$PATH 以下のコマンドで変更した~/.zshrcを再読み込みします。 ※ターミナル再起動でもOKです! $ source ~./zshrc 以下のコマンドでバージョンを確かめると $ nodebrew -v 最新のv1.1.0になっていることがわかります。 $ nodebrew -v nodebrew 1.1.0 Usage: nodebrew help Show this message nodebrew install <version> Download and install <version> (from binary) nodebrew compile <version> Download and install <version> (from source) nodebrew install-binary <version> Alias of `install` (For backward compatibility) nodebrew uninstall <version> Uninstall <version> nodebrew use <version> Use <version> nodebrew list List installed versions nodebrew ls Alias for `list` nodebrew ls-remote List remote versions nodebrew ls-all List remote and installed versions nodebrew alias <key> <value> Set alias nodebrew unalias <key> Remove alias nodebrew clean <version> | all Remove source file nodebrew selfupdate Update nodebrew nodebrew migrate-package <version> Install global NPM packages contained in <version> to current version nodebrew exec <version> -- <command> Execute <command> using specified <version> node v16.0.0 インストール nodebrewのインストールが終わったので、node v16.0.0をインストール $ nodebrew install v16.0.0 こんな感じにログがでてインストールが完了します。 Fetching: https://nodejs.org/dist/v16.0.0/node-v16.0.0-darwin-arm64.tar.gz ####################################################################################################################### 100.0% Installed successfully 以下のコマンドでインストールされたNodeのバージョンを確かめると $ nodebrew ls 以下のようにでるので、 use v16.0.0 v16.0.0を使用する以下のコマンドを入力 $ nodebrew use v16.0.0 最後にNodeのバージョンを以下のコマンドで確認 $ node -v 以下のようにでれば成功です! v16.0.0

Viewing all articles
Browse latest Browse all 9360

Trending Articles