JavaScriptNode.js

Upgrade the version of nodenv through the anyenv ( Resolving un-listed Node.js version 18 issue)

The provided text explains how to resolve the issue of not being able to find Node.js version 18 using the nodenv install –list command. The author suggests upgrading nodenv using the anyenv command, as the usual method of upgrading through brew may not work when anyenv is used. After reinstalling nodenv and restarting the shell session, the user should be able to install Node.js version 18 using the nodenv install –list command. The author concludes by emphasizing the importance of understanding how to manage different language versions when using different version managers like nodenv.

広告ここから
広告ここまで

The short note resolving my issue that the Node.js version 18 was unlisted on the nodenv.

Problems

When I tried to upgrade the Node.js version on my local machine, I couldn’t find version 18 on the lists of the result of nodenv install —list command.

% nodenv install --list
17.0.1
17.1.0
17.2.0
chakracore-dev
chakracore-nightly

I was using this nodeenv version at that moment.

% nodenv -v
nodenv 1.4.1+79.15375bb

Upgrade nodenv through the anyenv

Usually, we upgrade the version of nodenv by running brew upgrade nodenv command. But if we’re using anyenv, we need to install nodenv again from the anyenv command:

% anyenv install nodenv       
anyenv: /Users/okamotohidetaka/.anyenv/envs/nodenv already exists
Reinstallation keeps versions directories
continue with installation? (y/N) y

After re-installing nodenv, we need to restart the new shell session.

% exec $SHELL -l

The version of nodenv has been upgraded.

% nodenv -v     
nodenv 1.4.1

Finally, we can install the Node.js version 18 through by nodenv command.

% nodenv install --list | grep -e "^18"
18.0.0
18.1.0
18.2.0
18.3.0
18.4.0
18.5.0
18.6.0
18.7.0
18.8.0
18.9.0
18.9.1
18.10.0
18.11.0
18.12.0
18.12.1
18.13.0
18.14.0
18.14.1
18.14.2
18.15.0
18.16.0
18.16.1
18.17.0
18.17.1

Conclusion

Sometimes, we need to upgrade the xenv command like nodenv from the anyenv command. And upgrading each env command by the brew is not working well when we’re using anyenv.

So, we should remember how we manage each language version.

Referenced docs (Japanese)

ブックマークや限定記事(予定)など

WP Kyotoサポーター募集中

WordPressやフロントエンドアプリのホスティング、Algolia・AWSなどのサービス利用料を支援する「WP Kyotoサポーター」を募集しています。
月額または年額の有料プランを契約すると、ブックマーク機能などのサポーター限定機能がご利用いただけます。

14日間のトライアルも用意しておりますので、「このサイトよく見るな」という方はぜひご検討ください。

広告ここから
広告ここまで

Related Category posts