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 your minimatch@3.0.4
introduces some new features, now glob@4.5.3
might stop working, and in turn gulp@3.9.1
might stop working as well.
You should either:
Update to a new gulp
version without worrying about minimatch
npm update gulp
or use the latest version of minimatch
directly, using
npm install minimatch
If however you really want to perform the operation for whatever reason, you could try the following ugly hack:
- install minimatch somewhere in a random location with
npm install minimatch@3.0.4
- go to the
node_modules
folder in this location and copy the minimatch
folder
- find your gulp installation folder (this may depend on your system,
C:\Users\user\AppData\Roaming\npm\node_modules\gulp
on Windows or /usr/lib/node_modules/gulp/
on Linux)
- search for
minimatch
inside the gulp
installation folder (find . | grep minimatch
)
- replace all the found
minimatch
folders with the one you just installed in the random location
At this point gulp
should use the updated minimatch
, although npm list
will still display the old version number.
Again, this is highly not recommended and only provided for the sake of answering the question.