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

Types issue with Glob and Minimatch #264

Closed
cbartondock opened this issue Apr 6, 2023 · 10 comments
Closed

Types issue with Glob and Minimatch #264

cbartondock opened this issue Apr 6, 2023 · 10 comments

Comments

@cbartondock
Copy link

When I run rimraf dist I see:

node_modules/@types/glob/index.d.ts:29:42 - error TS2694: Namespace 

'"D:/Projects/Development/steam-rom-manager/node_modules/minimatch/dist/cjs/index"' 

has no exported member 'IOptions'. 

29     interface IOptions extends minimatch.IOptions {                                                                                                                                                                                                                                                                                                                     

node_modules/@types/glob/index.d.ts:74:30 - error TS2724: 

'"D:/Projects/Development/steam-rom-manager/node_modules/minimatch/dist/cjs/index"' 

has no exported member named 'IMinimatch'. Did you mean 'Minimatch'? 

74         minimatch: minimatch.IMinimatch;                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Found 2 errors in the same file, starting at: node_modules/@types/glob/index.d.ts:29

Error is also noted here, and the solution is to not run rimraf:
https://stackoverflow.com/questions/75890950/node-modules-minimatch-dist-cjs-index-has-no-exported-member-ioptions

Minimatch, glob, and @types/minimatch and @types/glob are all at their latest version.

@isaacs
Copy link
Owner

isaacs commented Apr 6, 2023

You shouldn't need those @types packages if rimraf glob and minimatch are all at latest. They're written in typescript. Maybe remove those?

@isaacs
Copy link
Owner

isaacs commented Apr 6, 2023

Confirmed, the @types are borked. Remove them and it works just fine.

npm rm @types/glob @types/rimraf @types/minimatch
npm i rimraf@latest

@isaacs isaacs closed this as completed Apr 6, 2023
@cbartondock
Copy link
Author

Thanks this does work, although it is still bit annoying since @types/glob is listed as an (optional) dependency for @electron/asar, so running npm install will put it right back.

@isaacs
Copy link
Owner

isaacs commented Apr 7, 2023

Sounds like @electron/asar needs to not have that optional dep. DT types should usually only ever be dev deps. Tell 'em I sent ya.

@isaacs
Copy link
Owner

isaacs commented Apr 7, 2023

I'd help more, but there's literally nothing I can do. I don't maintain electron, definitelytyped, or typescript. Fwiw I did request that they remove the @types/glob type, or make it a stub, because glob has its own types now.

@cbartondock
Copy link
Author

cbartondock commented Apr 7, 2023

Thanks for your help!

@TVS-IT-3
Copy link

TVS-IT-3 commented Dec 20, 2023

@isaacs
I am also facing the same issue,
node_modules/minimatch/dist/cjs/index"' has no exported member 'IOptions'.
node_modules@types\glob\index.d.ts 29
C:\Users\xxx\Source\repos\xxxx\Angular\tsconfig.json

Do you want to remove the @types/glob type? If I remove the glob folder , its regenerating the folder again.
I can't ask everyone to do the same, right?

Do I need to make any changes to the package.json or tsconfig file? becuase I want to push the code our QA server without any issue.

@rodchenkov
Copy link

I have same issue with [email protected] that has dependency on @types/[email protected] but can't figure out how to solve it. Sorry not an expert at Angular and npm :)

Can you please help me?

@isaacs
Copy link
Owner

isaacs commented Dec 28, 2023

Please follow the steps I detailed above.

Repository owner locked and limited conversation to collaborators Dec 28, 2023
@isaacs
Copy link
Owner

isaacs commented Dec 28, 2023

#264 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants