Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎样使它像nvm一样,npm和node都是各自隔离的呢? #13

Open
lzcmaro opened this issue Dec 5, 2016 · 5 comments
Open

怎样使它像nvm一样,npm和node都是各自隔离的呢? #13

lzcmaro opened this issue Dec 5, 2016 · 5 comments

Comments

@lzcmaro
Copy link

lzcmaro commented Dec 5, 2016

现在好像和n一样,node虽然可以切换,但它的npm共用一个,全局安装的包可能会出现版本问题。

@lzcmaro lzcmaro changed the title 怎样使它像nvm一样,npm和node都是各自隔离的呢?这样全局的npm包不会出现版本问题。 怎样使它像nvm一样,npm和node都是各自隔离的呢? Dec 5, 2016
@Kenshin
Copy link
Owner

Kenshin commented Dec 5, 2016

目前没有关于 npm 多版本管理的功能,你的意思是需要 npm 也具有多版本切换功能?

@lzcmaro
Copy link
Author

lzcmaro commented Dec 6, 2016

是呀,之前遇到过这样的坑。在切换node版本时,却由于全局的npm包共用同一份,在编译代码时可能有错,如果使用了全局包的话。

@Kenshin
Copy link
Owner

Kenshin commented Dec 6, 2016

okay,我把它加到 To-do 里面,下个版本实现,感谢建议~

@shellphon
Copy link

我在用的是nvm-windows版本,朋友推荐gnvm,所以过来看看,在nvm,npm是 跟着下载的node版本走的,这样全局安装的包就不会有不兼容问题(因为不共用)。我还看到nvm有一个reinstall-package-from的用法,可以从特定版本导入安装包,这个减轻了更换版本时要重新安装各种全局包的操作,不过貌似nvm-windows 不支持这个选项
如果作者也打算加入npm多版本管理的话,考虑一下这个选项?

@Kenshin
Copy link
Owner

Kenshin commented Sep 6, 2017

@shellphon
感谢你的朋友推荐 gnvm 😉

目前 gnvmnpm 的管理还是较薄弱,只能做 升级 更换 等基础操作。最近在忙的业余项目是 简悦 ,等这个产品稳定后,我会考虑升级 gnvm 尤其是 npm 的部分。

当然会借鉴同类工具的特点。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants