Depending on the Time and Situation

時と場合によりけり 〜 日々のアップデートとイノベーションに翻弄され彷徨える IT エンジニアの覚書

Mac に anyenv で ndenv をインストール

概要

先日の投稿で、Mac に anyenv を入れました。今回は、anyenv で ndenv をインストールしてみます。

f:id:stangler:20190120122924p:plain

stangler.hatenablog.com

この記事の目次

ホスト

Mac

support.apple.com

なんとか env の確認

ターミナルで以下のコマンドを実行し、anyenv でインストールできる、なんとか env を確認します。

% anyenv install -l

以下のように表示されると思います。Node.js をインストールするためには、ndenv、nenv、nodenv のどれかを入れることになるのですが、今回は、ndenv をインストールします。

Available **envs:
  Renv
  crenv
  denv
  erlenv
  exenv
  goenv
  hsenv
  jenv
  luaenv
  ndenv
  nenv
  nodenv
  phpenv
  plenv
  pyenv
  rbenv
  sbtenv
  scalaenv
  swiftenv

ndenv インストール

それでは、anyenv を使って ndenv をインストールします。ターミナルを開いて以下のコマンドを実行してください。

% anyenv install ndenv

確認

以下のコマンドを実行して、ndenv が作動するかどうか確認します。

% ndenv

以下のように表示されていれば OK です!

ndenv 0.4.0-5-g6ee4840
Usage: ndenv <command> [<args>]

Some useful ndenv commands are:
   commands    List all available ndenv commands
   local       Set or show the local application-specific Node version
   global      Set or show the global Node version
   shell       Set or show the shell-specific Node version
   install     Install a Node version using the node-build plugin
   uninstall   Uninstall a specific Node version
   rehash      Rehash ndenv shims (run this after installing executables)
   version     Show the current Node version and its origin
   versions    List all Node versions available to ndenv
   which       Display the full path to an executable
   whence      List all Node versions that contain the given executable

See `ndenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/riywo/ndenv#readme

次回は、Node.js をインストールします。