情况
PS D:\code\work> gcm mona
Get-Command: The term 'mona' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS D:\code\work> bun i -g mona-cli
bun add v1.3.3 (274e01c7)
installed mona-cli@0.2.0 with binaries:
- mona
- mo
1 package installed [39.00ms]
PS D:\code\work> gcm mona
CommandType Name Version Source
----------- ---- ------- ------
Application mona.exe 0.0.0.0 C:\Users\32956\.bun\bin\mona.exe
PS D:\code\work> bun remove -g mona-cli
bun remove v1.3.3 (274e01c7)
- mona-cli
1 package removed [12.00ms]
PS D:\code\work> gcm mona
CommandType Name Version Source
----------- ---- ------- ------
Application mona.exe 0.0.0.0 C:\Users\32956\.bun\bin\mona.exe
卸载完命令还是存在。
评价
bun不适合作为全局包的管理工具。
甚至其本身作为包管理器也不是很成熟,建议只将其作为运行时来使用,降低使用的成本,避免由包管理器带来的一系列问题。
目前最适合管理全局的依然是npm。