vue脚手架中package.json配置中的版本问题(~和^的区别)

vue脚手架中package.json配置中的版本问题(~和^的区别)_第1张图片
package.json

最近接手别人的一个项目,其中有一个按钮显示不出来也不报错,困扰了我好久,原来是iview的版本问题。

后来我发现npm install的时候 iview版本自动更新到最新的版本,我只好npm install后再下载自己需要的版本号。

cnpm install [email protected] --save


vue脚手架中package.json配置中的版本问题(~和^的区别)_第2张图片
如果输错就会报出404,注意npm写规范


vue脚手架中package.json配置中的版本问题(~和^的区别)_第3张图片
下载对应的banben


'~'(波浪符号):他会更新到当前minor version(也就是中间的那位数字)中最新的版本。放到我们的例子中就是:"exif-js": "~2.3.0",这个库会去匹配更新到2.3.x的最新版本,如果出了一个新的版本为2.4.0,则不会自动升级。波浪符号是曾经npm安装时候的默认符号,现在已经变为了插入符号。


'^'(插入符号): 这个符号就显得非常的灵活了,他将会把当前库的版本更新到当前major version(也就是第一位数字)中最新的版本。放到我们的例子中就是:"vue": "^2.2.2", 这个库会去匹配2.x.x中最新的版本,但是他不会自动更新到3.0.0。


‘2.0.0-rc.11’如果直接写版本号,就会下载到当时依赖的版本。


但是如果有一些依赖在后期修改了存在的bug,如果还用之前的依赖,没准就会报错。

所以推荐使用"^"的写法。


只有极个别的依赖对低版本的语法是不支持的,比如iview到2018-08-13日已经有153个版本。

当前标签

3.0.0

最新

版本历史

3.0.0

16 days ago

2.14.3

2 months ago

2.14.2

2 months ago

2.14.1

2 months ago

2.14.0

3 months ago

2.14.0-rc.5

3 months ago

2.14.0-rc.4

3 months ago

2.14.0-rc.3

3 months ago

2.14.0-rc.2

3 months ago

2.14.0-RC.1

3 months ago

2.13.1

4 months ago

2.13.1-RC.1

4 months ago

2.13.0

4 months ago

2.12.0

4 months ago

2.12.0-RC.1

4 months ago

2.11.0

5 months ago

2.11.0-RC.1

5 months ago

2.10.1

5 months ago

2.10.0

5 months ago

2.10.0-RC.1

5 months ago

2.9.2

6 months ago

2.9.1

6 months ago

2.9.0

7 months ago

2.9.0-rc.2

7 months ago

2.9.0-RC.1

7 months ago

2.8.0

8 months ago

2.8.0-rc.5

8 months ago

2.8.0-rc.4

8 months ago

2.8.0-rc.3

8 months ago

2.8.0-rc.2

8 months ago

2.8.0-RC.1

8 months ago

2.7.4

8 months ago

2.7.3

9 months ago

2.7.3-beta.1

9 months ago

2.7.2

9 months ago

2.7.1

9 months ago

2.7.0

9 months ago

2.7.0-beta.1

9 months ago

2.6.0

10 months ago

2.6.0-beta.1

10 months ago

2.5.1

10 months ago

2.5.0

10 months ago

2.5.0-beta.2

10 months ago

2.5.0-beta.1

10 months ago

2.4.0

a year ago

2.4.0-beta.3

a year ago

2.4.0-beta.2

a year ago

2.4.0-beta.1

a year ago

2.3.2

a year ago

2.3.1

a year ago

2.3.0

a year ago

2.3.0-beta.3

a year ago

2.3.0-beta.2

a year ago

2.3.0-beta.1

a year ago

2.2.0

a year ago

2.1.0

a year ago

2.0.0

a year ago

2.0.0 rc.19

a year ago

2.0.0 rc.18

a year ago

2.0.0 rc.17

a year ago

2.0.0 rc.16

a year ago

2.0.0 rc.15

a year ago

2.0.0 rc.14

a year ago

2.0.0 rc.13

a year ago

2.0.0 rc.12

a year ago

2.0.0 rc.11

a year ago

2.0.0 rc.10

a year ago

2.0.0 rc.9

a year ago

2.0.0 rc.8

a year ago

1.0.2

a year ago

2.0.0 rc.7

a year ago

2.0.0 rc.6

a year ago

2.0.0 rc.5

a year ago

2.0.0 rc.4

a year ago

2.0.0 rc.3

a year ago

2.0.0 rc.2

a year ago

2.0.0 RC.1

a year ago

1.0.1

a year ago

1.0.0

a year ago

0.9.17

2 years ago

0.9.16

2 years ago

0.9.15

2 years ago

0.9.14

2 years ago

0.9.13

2 years ago

0.9.13-RC-2

2 years ago

0.9.13-RC-1

2 years ago

0.9.12

2 years ago

0.9.11

2 years ago

0.9.11-RC-5

2 years ago

0.9.11-RC-4

2 years ago

0.9.11-RC-3

2 years ago

0.9.11-RC-2

2 years ago

0.9.11-RC-1

2 years ago

0.9.10

2 years ago

0.9.10-RC-4

2 years ago

0.9.10-RC-3

2 years ago

0.9.10-RC-1

2 years ago

0.9.9

2 years ago

0.9.9-RC-6

2 years ago

0.9.9-RC-5

2 years ago

0.9.9-RC-4

2 years ago

0.9.9-RC-3

2 years ago

0.9.9-RC-2

2 years ago

0.9.9-RC-1

2 years ago

0.9.8

2 years ago

0.9.8-RC-5

2 years ago

0.9.8-RC-4

2 years ago

0.9.8-RC-3

2 years ago

0.9.8-RC-2

2 years ago

0.9.8-RC-1

2 years ago

0.9.7

2 years ago

0.9.7-RC-1

2 years ago

0.9.6

2 years ago

0.9.5

2 years ago

0.9.5-RC-9

2 years ago

0.9.5-RC-8

2 years ago

0.9.5-RC-7

2 years ago

0.9.5-RC-6

2 years ago

0.9.5-RC-4

2 years ago

0.9.5-RC-3

2 years ago

0.9.5-RC-2

2 years ago

0.9.5-RC-1

2 years ago

0.9.4

2 years ago

0.9.4-RC-5

2 years ago

0.9.4-RC-4

2 years ago

0.9.4-RC-3

2 years ago

0.9.4-RC-2

2 years ago

0.9.4-RC-1

2 years ago

0.9.3

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.9.0

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

其中最坑的是iview中,表格渲染的render函数,

2.0.0-rc版本和其他2.0+版本用法完全不同。

在2.0.0-rc和以前的版本,render接收两个参数,如今render接收三个参数。且行且珍惜...

你可能感兴趣的:(vue脚手架中package.json配置中的版本问题(~和^的区别))