LoginSignup
0
0

Mac(M2) で古いバージョンのnodeをnodenv経由で入れる

Posted at

概要

macにnodenv経由でnode12.22.10を導入しようとしたところエラーが発生
解消方法の備忘録

  • rosseta を利用する
  • rosetta のコマンド経由の導入
  • nodenv install

今回の環境

mac 13.0(M2)
nodenv 1.4.1
node 12.22.10

エラー概要

$ nodenv install 12.22.10    
Downloading node-v12.22.10.tar.gz...
-> https://nodejs.org/dist/v12.22.10/node-v12.22.10.tar.gz

WARNING: node-v12.22.10 is in LTS Maintenance mode and nearing its end of life.
It only receives *critical* security updates, *critical* bug fixes and documentation updates.

Installing node-v12.22.10...

BUILD FAILED (OS X 13.0 using node-build 4.9.120)

Inspect or clean up the working tree at /var/folders/lx/59ywg_p95pjdkrhfg_0gzsgh0000gn/T/node-build.20230822140229.81515.UZLdgG
Results logged to /var/folders/lx/59ywg_p95pjdkrhfg_0gzsgh0000gn/T/node-build.20230822140229.81515.log

Last 10 log lines:
make: python: Command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
make: python: Command not found
Missing or stale config.gypi, please run ./configure
make: *** [config.gypi] Error 1

どうやらビルドに失敗している様子であることがわかる
詳しく解説については割愛

対応

rossettaを使用して開く

「rosettaを使用して開く」を使う

スクリーンショット 2023-08-22 14.34.23.png

自分の環境ではインストールに失敗しましたと発生
原因はrossettaが入っていないことが原因だった

Intel系のアプリの起動時にrossetta導入のアナウンスがあるらしいが自分の環境では表示されなかった
手動でrossetta導入する

rossettaのコマンド経由の導入

以下コマンドでインストールを実行する

$ softwareupdate --install-rosetta --agree-to-license

以下のリターンが確認出来れば導入完了

Install of Rosetta 2 finished successfully

動作確認

「rosettaを使用して開く」を使い、再度ターミナルを起動する

$ uname -m
x86_64

nodenv install

nodenv install 12.22.10
Downloading node-v12.22.10-darwin-x64.tar.gz...
-> https://nodejs.org/dist/v12.22.10/node-v12.22.10-darwin-x64.tar.gz

WARNING: node-v12.22.10-darwin-x64 is in LTS Maintenance mode and nearing its end of life.
It only receives *critical* security updates, *critical* bug fixes and documentation updates.

Installing node-v12.22.10-darwin-x64...
Installed node-v12.22.10-darwin-x64 to /Users/ejirinaohiro/.nodenv/versions/12.22.10

Installing Yarn...
/Users/ejirinaohiro/.nodenv/versions/12.22.10/bin/yarn -> /Users/ejirinaohiro/.nodenv/versions/12.22.10/lib/node_modules/yarn/bin/yarn.js
/Users/ejirinaohiro/.nodenv/versions/12.22.10/bin/yarnpkg -> /Users/ejirinaohiro/.nodenv/versions/12.22.10/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.22.19
added 1 package in 0.714s
Installed Yarn 1.22.19

成功!

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