New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'minimatch' #3922

Closed
MatrixV01 opened this Issue Nov 19, 2015 · 7 comments

Comments

Projects
None yet
8 participants
@MatrixV01
Copy link

MatrixV01 commented Nov 19, 2015

Issue: Cannot find module 'minimatch'

Identified as Node Installer, not NPM, issue. Copying from NPM Issues Repo.

npm/npm#10449
npm/npm#10434

upgraded node version 5x and started getting this error.

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'i',
1 verbose cli '-g',
1 verbose cli 'yo' ]
2 info using npm@3.3.12
3 info using node@v5.1.0
4 verbose stack Error: Cannot find module 'minimatch'
4 verbose stack at Function.Module._resolveFilename (module.js:338:15)
4 verbose stack at Function.Module._load (module.js:289:25)
4 verbose stack at Module.require (module.js:366:17)
4 verbose stack at require (module.js:385:17)
4 verbose stack at Object. (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\node_modules\glob\glob.js:44:17)
4 verbose stack at Module._compile (module.js:425:26)
4 verbose stack at Object.Module._extensions..js (module.js:432:10)
4 verbose stack at Module.load (module.js:356:32)
4 verbose stack at Function.Module._load (module.js:313:12)
4 verbose stack at Module.require (module.js:366:17)
5 verbose cwd X:\cafeV2
6 error Windows_NT 6.2.9200
7 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "i" "-g" "yo"
8 error node v5.1.0
9 error npm v3.3.12
10 error code MODULE_NOT_FOUND
11 error Cannot find module 'minimatch'
12 error If you need help, you may report this error at:
12 error https://github.com/npm/npm/issues
13 verbose exit [ 1, true ]

@MatrixV01

This comment has been minimized.

Copy link

MatrixV01 commented Nov 19, 2015

Multiple confirmed fix:

"I was able to clear it by doing a full Node/NPM uninstall by hunting down all associated files, deleting them completely and reinstalling Node 5 from the standard link on Nodejs.org front page. I used this link for full uninstall http://benznext.com/completely-uninstall-node-js-from-mac-os-x/"

@MylesBorins

This comment has been minimized.

Copy link
Member

MylesBorins commented Nov 19, 2015

this is a dupe of #3606

Thank you for reporting though! Hopefully we'll have a fix sooner than later

@evil-shrike

This comment has been minimized.

Copy link

evil-shrike commented Dec 17, 2015

I had this error after I upgraded from node 0.12.x to nodejs 5 on Windows Srv 2008 R2 via chocolatey.

Here's stack:

Error: Cannot find module 'minimatch'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\node_modules\glob\glob.js:44:17)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)

There was 'minimatch' in "C:\Program Files\nodejs\node_modules\npm\node_modules\minimatch" obviously.

To fix it I had to remove C:\Program Files\node_modules\rimraf\node_modules folder. After that npm started working.

@michapixel

This comment has been minimized.

Copy link

michapixel commented Jan 21, 2016

@evil-shrike i have the same issue, but there is no such folder on my machine.

@squirrelsRduck

This comment has been minimized.

Copy link

squirrelsRduck commented Jan 22, 2016

@michapixel, just copy the folder URL that ends in rimraf, as shown in ur error logs (for deletion)

@jlit

This comment has been minimized.

Copy link

jlit commented Feb 23, 2016

For mac users, remove

/usr/local/lib/node_modules/npm/node_modules/rimraf/node_modules

@guilhermebruzzi

This comment has been minimized.

Copy link

guilhermebruzzi commented May 11, 2017

For ubuntu users, removing

/usr/local/lib/node_modules/npm/node_modules/rimraf/node_modules

also works! :D

And then I followed the steps of @spelunk on this issue: #9377

Copying the commands:

$ sudo n 6.
$ sudo npm install -g npm@3.10.0
$ sudo npm install -g npm@next
$ sudo n 7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment