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?
You can't and you shouldn't update subpackages (packages used as dependencies for other packages).
Node modules are designed to contain all dependencies with specified versions inside the
node_modules
, in order to avoid problems with new updates. Let's say yourminimatch@3.0.4
introduces some new features, nowglob@4.5.3
might stop working, and in turngulp@3.9.1
might stop working as well.You should either:
Update to a new
gulp
version without worrying aboutminimatch
or use the latest version of
minimatch
directly, usingIf however you really want to perform the operation for whatever reason, you could try the following ugly hack:
npm install minimatch@3.0.4
node_modules
folder in this location and copy theminimatch
folderC:\Users\user\AppData\Roaming\npm\node_modules\gulp
on Windows or/usr/lib/node_modules/gulp/
on Linux)minimatch
inside thegulp
installation folder (find . | grep minimatch
)minimatch
folders with the one you just installed in the random locationAt this point
gulp
should use the updatedminimatch
, althoughnpm list
will still display the old version number.Again, this is highly not recommended and only provided for the sake of answering the question.
Here is my solution, you can create symbolic link for minimatch package by using
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.
here is documentation https://docs.npmjs.com/cli/link