Skip to content
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
Closed

Cannot find module 'minimatch' #3922

MatrixV01 opened this issue Nov 19, 2015 · 7 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@MatrixV01
Copy link

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
Copy link
Author

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
Copy link
Contributor

this is a dupe of #3606

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

@ChALkeR ChALkeR added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Nov 19, 2015
@evil-shrike
Copy link

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
Copy link

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

@squirrelsRduck
Copy link

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

@jlit
Copy link

jlit commented Feb 23, 2016

For mac users, remove

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

@guilhermebruzzi
Copy link

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
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

8 participants