事象
Windows環境にて、fnmを使用してnode.jsのアップグレードを実行しようとしたところ、タイトルどおりのエラーが発生した。
原因
環境変数が設定されていない模様。
error: We can't find the necessary environment variables to replace the Node version.
You should setup your shell profile to evaluate `fnm env`, see https://github.com/Schniz/fnm#shell-setup on how to do this
Check out our documentation for more information: https://fnm.vercel.app
対処
環境変数を追加するコマンドを実行した。
fnm env --use-on-cd | Out-String | Invoke-Expression