Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

Tags:

npm

cordova

I'm getting below warning while installing cordova. How I can resolve it?

enter image description here Please see the image to know what happened when i ran below commands :

npm update [email protected]

npm update -d

enter image description here

like image 204
Anjana Avatar asked Jun 27 '16 05:06

Anjana


People also ask

What is npm Minimatch?

A minimal matching utility. This is the matching library used internally by npm. It works by converting glob expressions into JavaScript RegExp objects.

How do I check my Minimatch version?

'npm -v minimatch' doesn't display the minimatch version but the version of npm you're actually using. You can try to 'npm -v dslkjfhrslkfhjezfmlhj' and you'll get the same result. An easy way to display your installed packaged and their version is this command : 'npm list -g --depth=0'.


2 Answers

npm update -g [email protected] Resolved this for me, no sweat, let me know if it doesn't work for you. Looking at your screenshots this is 90%+ likely to fix it, I think.

Looks like [email protected] which is listed in a couple of the cordova packages, has a dependency on [email protected] which has a dependency on [email protected]

This is an example of why npm is the package manager of infinite madness. I still like modern JavaScript, but npm is as dangerous as it is useful, in my opinion.

like image 135
Jeremy Anderson Avatar answered Sep 23 '22 03:09

Jeremy Anderson


This is what I did to update minimatch

Following a comment on this GitHub issue,

$ npm update minimatch $ npm -v 2.10.1 $ npm install -g npm@3 /usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js [email protected] /usr/local/lib/node_modules/npm $ npm install -g [email protected] /usr/local/lib └─┬ [email protected]    └─┬ [email protected]      ├── [email protected]      └── [email protected]   $ npm -v 3.10.5 $npm view minimatch version 3.0.2 
like image 41
Dave Everitt Avatar answered Sep 23 '22 03:09

Dave Everitt