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

v6 breaks node14 support #136

Closed
blaaat opened this issue Jan 25, 2024 · 1 comment · Fixed by #138
Closed

v6 breaks node14 support #136

blaaat opened this issue Jan 25, 2024 · 1 comment · Fixed by #138

Comments

@blaaat
Copy link

blaaat commented Jan 25, 2024

Environment

Node 14

Reproduction

I'm using a nuxt 2 project

Describe the bug

ERROR arr.at is not a function

index.cjs:29
return arr.length > 0 ? arr.at(-1) : null;

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at

.at is supported starting at node v16.6

Package.json still required node14+
"engines": { "node": ">=14.21.3" }

Additional context

No response

Logs

No response

@rickhc3
Copy link

rickhc3 commented Jan 30, 2024

I came across the same issue and managed to resolve it by using Yarn's resolutions field in my package.json. This approach allows you to override the version of a transitive dependency like webpackbar. Here's how you can do it:

Add the resolutions Field in package.json

In your package.json file, add a resolutions field specifying the version of webpackbar that you want to use. For example, if you want to force version 5.0.2, your package.json should include:

{
  // ... other configurations
  "resolutions": {
    "webpackbar": "5.0.2"
  }
}

Install Dependencies with Yarn

After adding the resolutions field, run yarn install in your project directory. Yarn will respect the specified resolutions and install webpackbar version 5.0.2, regardless of the version required by other dependencies.

Verify the Dependency Version

You can then check if the correct version of webpackbar is installed using yarn list webpackbar.

This method is straightforward with Yarn as it supports the resolutions field natively. However, remember that overriding dependency versions can sometimes lead to compatibility issues, so make sure to test your application thoroughly after making such changes.

Hope this helps!

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

Successfully merging a pull request may close this issue.

2 participants