Ruby で古い環境を作っていたのは以下。
じゃあ Node (nodenv) だとどうすんの? みたいな話があったので試してみた。
アーキテクチャを指定する
古くて ARM に対応していないようなものは arch -x86_64 を付与してインストールするといいらしい。
失敗する時
たとえば以下のよなパターン。
❯ nodenv install 12.22.12 To follow progress, use 'tail -f /var/folders/np/w6ml9cp529j92kms59xq43lr0000gn/T/node-build.20250329034534.57360.log' or pass --verbose Downloading node-v12.22.12.tar.gz... -> https://nodejs.org/dist/v12.22.12/node-v12.22.12.tar.gz WARNING: node-v12.22.12 is past its end of life and is now unsupported. It no longer receives bug fixes or security updates. Installing node-v12.22.12... BUILD FAILED (macOS 15.3.2 using node-build 5.3.27) ... pyenv: python2.7: command not found
python2 系がない? らしいので、 global に無理やり追加して試してみる。
❯ nodenv install 12.22.12 To follow progress, use 'tail -f /var/folders/np/w6ml9cp529j92kms59xq43lr0000gn/T/node-build.20250329035818.20249.log' or pass --verbose Downloading node-v12.22.12.tar.gz... -> https://nodejs.org/dist/v12.22.12/node-v12.22.12.tar.gz WARNING: node-v12.22.12 is past its end of life and is now unsupported. It no longer receives bug fixes or security updates. Installing node-v12.22.12... BUILD FAILED (macOS 15.3.2 using node-build 5.3.27) Inspect or clean up the working tree at /var/folders/np/w6ml9cp529j92kms59xq43lr0000gn/T/node-build.20250329035818.20249.ia5XTq Results logged to /var/folders/np/w6ml9cp529j92kms59xq43lr0000gn/T/node-build.20250329035818.20249.log Last 10 log lines: 245 | __has_trivial_copy(T) && __has_trivial_destructor(T); | ^ ../deps/v8/src/base/macros.h:245:32: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins] 245 | __has_trivial_copy(T) && __has_trivial_destructor(T); | ^ 2 warnings generated. 2 warnings generated. 2 warnings generated. rm d6e19044edfcf38990bf0d5062a941b1d10f4749.intermediate make: *** [node] Error 2
アーキテクチャを指定する。
❯ arch -x86_64 nodenv install 12.22.12 To follow progress, use 'tail -f /var/folders/np/w6ml9cp529j92kms59xq43lr0000gn/T/node-build.20250329040407.46556.log' or pass --verbose Downloading node-v12.22.12-darwin-x64.tar.gz... -> https://nodejs.org/dist/v12.22.12/node-v12.22.12-darwin-x64.tar.gz WARNING: node-v12.22.12-darwin-x64 is past its end of life and is now unsupported. It no longer receives bug fixes or security updates. Installing node-v12.22.12-darwin-x64... Installed node-v12.22.12-darwin-x64 to /Users/donbulinux/.anyenv/envs/nodenv/versions/12.22.12 Installing Yarn... /Users/donbulinux/.anyenv/envs/nodenv/versions/12.22.12/bin/yarn -> /Users/donbulinux/.anyenv/envs/nodenv/versions/12.22.12/lib/node_modules/yarn/bin/yarn.js /Users/donbulinux/.anyenv/envs/nodenv/versions/12.22.12/bin/yarnpkg -> /Users/donbulinux/.anyenv/envs/nodenv/versions/12.22.12/lib/node_modules/yarn/bin/yarn.js + yarn@1.22.22 added 1 package in 0.954s ╭───────────────────────────────────────────────────────────────╮ │ │ │ New major version of npm available! 6.14.13 → 9.4.0 │ │ Changelog: https://github.com/npm/cli/releases/tag/v9.4.0 │ │ Run npm install -g npm to update! │ │ │ ╰───────────────────────────────────────────────────────────────╯ Installed Yarn 1.22.22 NOTE: to activate this Node version as the new default, run: nodenv global 12.22.12
入った。 これにて解決!