package.json和bower.json dependencies依赖包中^符号和~符号前缀区别
Author:zhoulujun@live.cn Date:
在package.json里面dependencies依赖包的版本号前面的符号有两种,一种是~,一种是^。
~的意思是匹配最近的小版本 比如~1.0.2将会匹配所有的1.0.x版本,但不匹配1.1.0
^的意思是最近的一个大版本 比如1.0.2 将会匹配 所有 1.x.x, 但不包括2.x.x
版本号 x.y.z :其中z 表示一些小的bugfix, 更改z的号,
y表示一些大的版本更改,比如一些API的变化
x表示一些设计的变动及模块的重构之类的,会升级x版本号
比如:
"dependencies": {
"angular-animate": "~1.5.3",
"angular-touch": "~1.5.3",
"angular-sanitize": "~1.5.3",
"angular-messages": "~1.5.3",
"jquery": "~2.1.4",
"angular-resource": "~1.5.3",
"malarkey": "yuanqing/malarkey#~1.3.1",
"angular-toastr": "~1.5.0",
"moment": "~2.10.6",
"animate.css": "~3.4.0",
"angular": "~1.5.3",
"angular-ui-router": "^0.4.2",
"ionic": "1.3.2"
},
"devDependencies": {
"angular-mocks": "~1.5.3"
},
转载本站文章《 package.json和bower.json dependencies依赖包中^符号和~符号前缀区别》,
请注明出处:https://www.zhoulujun.cn/html/webfront/ECMAScript/nodejs/7979.html
延伸阅读:
- npm audit fix,fixed 0 of 1 vulnerability in 1 vulnerability required manual
- nodejs v4.4.2 LTS和 v5.10.1 Stable 有什么区别?
- module.js:440 throw err;
- 如何在mac上彻底卸载nodejs:Mac下彻底卸载node和npm
- npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher
- yeoman创建项目,nodejs报错Error: EACCES: permission denied, open
- nodejs yeoman 新建项目时候,报错,generator 没有安装
- nodejs查看npm安装所有包,并卸载多余的包
- dependencies与devDependencies之间的区别
- gulp插件browser-sync热更新导致浏览器卡死
- package.json中的browser/module/main字段与mjs杂谈
- 命令压缩js和css的方法
- npm包管理问题:安装nvm后如何管理各个版本间包
- mac与nodejs升级后:npm8安装git+https://github.com/包报错
- nodejs升级到最新LTS版本方法汇总:linux/mac/window—npm/yum/ssh
- koa服务器后台:Node.js 通过进程、线程优化的性能
- vue-cli报错You may need an additional loader to handle
- Syntax Error: Error: Cannot find module 'webpack/lib/RuleSet'
- nodejs多进程处理方案:pm2中的cluster与fork
- window powerShell node.js npm很多命令无法使用,如yarn vue
- vue2老项目从mac还到windows环境跑不起来,npm无法安装
- npm时报错解决EPERM: operation not permitted, lstat 记录
- 使用npm发布npm组件包和使用git上面的私有包操作笔记
- nodejs npm安装本地node-sass失败,ruby gem 安装sass失败总结
- npm 常用命令详解