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

NPM依赖包版本号~和^和*的区别 #104

Open
web-lzs opened this issue Mar 22, 2019 · 0 comments
Open

NPM依赖包版本号~和^和*的区别 #104

web-lzs opened this issue Mar 22, 2019 · 0 comments

Comments

@web-lzs
Copy link
Owner

web-lzs commented Mar 22, 2019

~ 会匹配最近的小版本依赖包,比如~1.2.3会匹配所有1.2.x版本,但是不包括1.3.0
^ 会匹配最新的大版本依赖包,比如^1.2.3会匹配所有1.x.x的包,包括1.3.0,但是不包括2.0.0
* 这意味着安装最新版本的依赖包

推荐使用~,只会修复版本的bug,比较稳定

使用^ ,有的小版本更新后会引入新的问题导致项目不稳定,
比如:之前的weex老项目安装依赖后页面无法显示,修改依赖版本后才正常

使用*, 同样有上述问题


来源:CSDN
原文:https://blog.csdn.net/p358278505/article/details/78247700

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

1 participant