如何使用npm更新特定的子包版本 [英] How to update specific sub-package version by using npm

查看:2032
本文介绍了如何使用npm更新特定的子包版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已检查全球包装minimatch for gulp

  $ npm list -g minimatch 

+ - gulp@3.9.1
| ` - vinyl-fs@0.3.14
| + - glob-stream@3.1.18
| | + - glob@4.5.3
| | | ` - minimatch@2.0.10扣除
| | ` - minimatch@2.0.10
| ` - glob-watcher@0.0.6
| ` - gaze@0.5.2
| ` - globules@0.1.0
| + - glob@3.1.21
| | ` - minimatch@0.2.14扣除
| ` - minimatch@0.2.14

现在,我想更新特定gulp包中的所有minimatch版本(所有minimatch@0.2.14和minimatch@3.04)到最新版本。



他们在npm中的任何命令是否更新了我现有的软件包依赖项?

解决方案

这是我的解决方案,您可以使用



<$ p $为minimatch包创建符号链接p> npm ln
npm link(在包dir中)
npm link [< @ scope> /]< pkg> [@< version>]

这里有更多解释的链接 https://docs.npmjs.com/cli/link



我认为你不能手动更新它们,因为如果出现问题,您将不得不删除所有内容并重新安装。它有一些迁移问题令你不安,然后尝试。

  npm audit [--json | --parseable] 
npm audit fix [--force | --package-lock-only | --dry-run | --production | --only = dev]

这里有文档 https://docs.npmjs.com/ cli / link


I had checked global package minimatch for gulp

$ npm list -g minimatch

+-- gulp@3.9.1
| `-- vinyl-fs@0.3.14
|   +-- glob-stream@3.1.18
|   | +-- glob@4.5.3
|   | | `-- minimatch@2.0.10  deduped
|   | `-- minimatch@2.0.10
|   `-- glob-watcher@0.0.6
|     `-- gaze@0.5.2
|       `-- globule@0.1.0
|         +-- glob@3.1.21
|         | `-- minimatch@0.2.14  deduped
|         `-- minimatch@0.2.14

Now, i wanted to update all minimatch versions from specific gulp package (all minimatch@0.2.14 and minimatch@3.04) to latest version.

Is their any command in npm that updates my existing package dependencies?

解决方案

Here is my solution, you can create symbolic link for minimatch package by using

npm ln
npm link (in package dir)
npm link [<@scope>/]<pkg>[@<version>]

here is link for more explanation https://docs.npmjs.com/cli/link

I think you must not update them manually, because if something comes up wrong, you will have to delete everything and install again. it there are some migration issue disturbing you then try.

npm audit [--json|--parseable]
npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=dev]

here is documentation https://docs.npmjs.com/cli/link

这篇关于如何使用npm更新特定的子包版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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