fnm node包管理器
for Mac / linux
release 里直接下载对应文件即可,将 bin 文件放入到 path中
https://github.com/Schniz/fnm/releases
mac 也可以使用 brew install fnm
有 fnm 命令之后在 profile 文件( .bashrc
或 .zshrc
)里添加
eval "$(fnm env --use-on-cd --shell bash)"
for windows
推荐使用 scoop
安装scoop
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserInvoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
之后使用 scoop 命令安装fnm
scoop install fnm
安装完 fnm 后修改 windows profile 文件
Invoke-Item $profile
在文本框中输入
fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression
这样就可以在文件目录中直接输入 powershell 来调起 powershell 工具时使用fnm 了
但是cmd 是不可以的