javascriptnode.jsnpmgulpminimatch

How to update specific sub-package version by using npm


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?


Solution

  • 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