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

ERROR: LRUCache is not a constructor #122

Closed
aminya opened this issue Oct 20, 2023 · 5 comments
Closed

ERROR: LRUCache is not a constructor #122

aminya opened this issue Oct 20, 2023 · 5 comments

Comments

@aminya
Copy link

aminya commented Oct 20, 2023

When I use npm-run-all2@6.1.1, I get this error when I try to use run-p:

>  run-s build

ERROR: LRUCache is not a constructor

The latest version that works is 6.0.5

@bcomnes
Copy link
Owner

bcomnes commented Oct 20, 2023

What version of node and npm are you running?

@aminya
Copy link
Author

aminya commented Oct 21, 2023

I use pnpm 8 and Node 20

@bcomnes
Copy link
Owner

bcomnes commented Oct 23, 2023

Unfortunately, I'm not seeing this behavior on my end, even when running with pnpm. I'll need more info and a reproducible case that you can share before I can do anything about this.

  • A repo that triggers it
  • The versions of the tools you are running
  • The OS you are running on

would be a good place to start.

@aminya
Copy link
Author

aminya commented Oct 23, 2023

You should be able to reproduce the error here (bump npm-run-all2 version before testing):
aminya/patha#10

I am on Linux, Node v20.8.1, pnpm 8.9.2

@bcomnes
Copy link
Owner

bcomnes commented Oct 23, 2023

Thanks, I see the issue now.

Your pnpm override:

https://github.com/aminya/patha/blob/master/package.json#L151C7-L151C28

Is causing a transitive of npm-run-all2 to resolve to an incompatible version (hosted-git-info wants LRUCache 10, but is getting 7). Remove the override and the tool continues to work. Its unfortunate that modules break their internal APIs all the time as these issue will always follow in unexpected ways though the use of override here is also part of the problem. This is just part of the cost of keeping up to to date with dependencies. Noting this as a point of future simplification for this tool but I dont have any bandwidth to fix now.

I wish devDependencies didn't merge with dependencies this way but thats just the way the tools are.

@bcomnes bcomnes closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants