1111mp / nvm-desktop

Node Version Manager Desktop - A desktop application to manage multiple active node.js versions.
https://github.com/1111mp/nvm-desktop
MIT License
621 stars 31 forks source link

期望界面增加一键安装全局包的功能 #77

Closed TanxiangCode closed 1 month ago

TanxiangCode commented 2 months ago

可以在界面上一键全局安装cnpm yarn pnpm等包,避免切换版本后,需要手动的使用-g命令安装。甚至如果能直接自定义命令就更好了。配置后,每次切换node版本后只需要点一下就执行了。。

1111mp commented 2 months ago

nvm-desktop 设计之初就是想让每个node之间都相互隔离、互不影响的,就跟自己本地新安装node一样。

不过应该有一个办法能够暂时解决这个问题,就是通过 npm config set prefix "/path/to/folder" 更改全局安装包的位置,这样切换 node 版本之后也能共用,就不需要再重新安装了。不过需要注意的是需要将 "/path/to/folder" 目录添加到系统环境变量(保证其优先级),具体可以参考:(https://github.com/1111mp/nvm-desktop/issues/23)

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale.