无法使用FNM切换node版本(报:error: We can't find the necessary environment variables to replace the Node version.)
问题:
1、无法使用 FNM 安装和使用 NodeJS(Unable to install and use NodeJS using FNM)
2、无法使用FNM切换node版本
提示:
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 use
命令前先执行下面这个命令
fnm env --use-on-cd | Out-String | Invoke-Expression
提示:该命令需要在Windows PowerShell
中执行
stackoverflow
https://stackoverflow.com/questions/78606679/unable-to-install-and-use-nodejs-using-fnm