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

Incompatibility with Node.js v16.9.1 in lru-cache v10.0.1 #32

Open
CodeByRat opened this issue Sep 30, 2023 · 3 comments
Open

Incompatibility with Node.js v16.9.1 in lru-cache v10.0.1 #32

CodeByRat opened this issue Sep 30, 2023 · 3 comments

Comments

@CodeByRat
Copy link

Description

When using lru-cache version 10.0.1 in a FiveM server running on Node.js v16.9.1, an error is thrown indicating an incompatible Node.js version. The error message is as follows:

Error: [yarn] error lru-cache@10.0.1: The engine "node" is incompatible with this module. Expected version "14 || >=16.14". Got "16.9.1"

Steps to Reproduce

Set up a FiveM server running on Node.js v16.9.1.
Create a TypeScript project with lru-cache version 10.0.1 as a dependency.
Attempt to build or run the project.

Expected Behavior

The project should build and run without error.

Actual Behavior

The above error message is thrown, indicating an incompatible Node.js version.

Workaround

Downgrading to an earlier version of lru-cache resolved the issue. I am using 5.1.1

@itschip
Copy link
Member

itschip commented Sep 30, 2023

Have you tried to just build the project yourself, instead of letting fxserver build it for you?

@DmACKGL
Copy link

DmACKGL commented Oct 16, 2023

This happened to me, too.

Have you tried to just build the project yourself, instead of letting fxserver build it for you?

The server does it automatically in the first run (sometimes even with the .yarn.installed). The issue happens because of the dep path-scurry after 1.6.3 when they upgraded lru-cache (isaacs/path-scurry@0a38f91)

There were other scripts affected too, mainly scripts that use DiscordJS (like EasyAdmin)

I use this as a workaround, overriding path-scurry and lru-cache in case some other dep uses it.

  "resolutions": {
    "path-scurry": "1.6.3",
    "lru-cache": "7.18.0"
  }

@VIRUXE
Copy link

VIRUXE commented Jan 9, 2024

This still happens. Even if .yarn.installed is present.

  "resolutions": {
    "path-scurry": "1.6.3",
    "lru-cache": "7.18.0"
  }

Tried this also but: warning Resolution field "path-scurry@1.6.3" is incompatible with requested version "path-scurry@^1.10.1" - which in fact makes it work but just not desired

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

4 participants