我怎样才能破坏所有依赖项? [英] How can I version bump all my dependencies?

查看:100
本文介绍了我怎样才能破坏所有依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

纱线过时是非常有用的,但我想避免在包裹上运行纱线升级

Having yarn outdated is quite informative but I'd like to avoid running over package by package doing yarn upgrade.

从纱线的文档中,只有纱线升级没有参数据说可以升级所有依赖项但是我没有变化project的 package.json 纱线过期显示的包装版本与以前相同。

From yarn's documentation, just yarn upgrade without arguments is said to upgrade all dependencies but there's no change in my project's package.json and yarn outdated shows the same packages versions than before.

是否有一些命令或参数只会破坏我的所有依赖关系?

Is there some command or argument that just bumps all my dependencies?

如果没有,这种做法是否会以某种方式阻止?

If not, is the practice discouraged in some way?

推荐答案

您可以使用纱线升级没有任何args。

You can update your packages to the latest version specified in the package.json using yarn upgrade without any args.

这取自 docs


纱线升级

此命令更新根据
在package.json文件中指定的版本范围,将所有依赖项更新为最新版本。 yarn.lock
文件也将被重新创建。

This command updates all dependencies to their latest version based on the version range specified in the package.json file. The yarn.lock file will be recreated as well.

这只会更新允许升级的软件包package.json例如使用 ^ (例如 ^ 0.13.0 将更新为版本 0.14.0 如果存在的话)。这不会更新你的package.json文件,但会更新yarn.lock。

This will only update packages that are allowed to be upgraded in the package.json e.g. using ^ (e.g. ^0.13.0 would update to version 0.14.0 if it exists). This will not update your package.json file, but it will update the yarn.lock.

如果要更新最新版本的依赖项,可以使用该包 npm-check-updates 这会更新你的package.json:

If you want to update dependencies in to the latest version you can use the package npm-check-updates which will update your package.json:

$ yarn global add npm-check-updates
$ npm-check-updates -u
$ yarn upgrade

这篇关于我怎样才能破坏所有依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆