Updating from 4.25.20 to 5.10.3 cause ERESOLVE could not resolve on installing dependencies
### Node Version

v18.19.0

### NPM/Yarn/PNPM Version

NPM 10.2.3

### Strapi Version

4.25.20

### Operating System

MacOS

### Database

PostgreSQL

### Javascript or Typescript

Javascript

### Reproduction URL

_No response_

### Bug Description

Trying to update a Strapi project from version 4.25.20 to 5.10.3
using 
`npx @strapi/upgrade latest`

cause this error:
```
➜  test-strapi git:(feature/strapi-v5) npx @strapi/upgrade latest
[WARN]  [2025-02-20T10:17:40.600Z] Please make sure you've created a backup of your codebase and files before upgrading
[WARN]  [2025-02-20T10:17:40.824Z] Detected a major upgrade for the "latest" tag: v4.25.20 > v5.10.3
✔ I know what I'm doing. Proceed anyway! … yes
[INFO]  [2025-02-20T10:17:42.022Z] Upgrading from v4.25.20 to v5.10.3
[INFO]  [2025-02-20T10:17:42.030Z] (1/4) Checking requirement...
[INFO]  [2025-02-20T10:17:42.137Z] (2/4) Applying the latest code modifications...
┌────┬─────────┬──────┬────────────────────────────────────────┬──────────┬───────────┬─────────────────────┐
│ N° │ Version │ Kind │ Name                                   │ Affected │ Unchanged │ Duration            │
├────┼─────────┼──────┼────────────────────────────────────────┼──────────┼───────────┼─────────────────────┤
│ 0  │ 5.0.0   │ code │ comment out lifecycle files            │ 0        │ 126       │ 0.372s (cold start) │
│ 1  │ 5.0.0   │ json │ dependency remove strapi plugin i18n   │ 0        │ 117       │ 0.128s              │
│ 2  │ 5.0.0   │ json │ dependency upgrade react and react dom │ 0        │ 117       │ 0.024s              │
│ 3  │ 5.0.0   │ json │ dependency upgrade react router dom    │ 1        │ 116       │ 0.022s              │
│ 4  │ 5.0.0   │ json │ dependency upgrade styled components   │ 1        │ 116       │ 0.018s              │
│ 5  │ 5.0.0   │ code │ deprecate helper plugin                │ 0        │ 126       │ 0.259s              │
│ 6  │ 5.0.0   │ code │ entity service document service        │ 0        │ 126       │ 0.080s              │
│ 7  │ 5.0.0   │ code │ s3 keys wrapped in credentials         │ 0        │ 126       │ 0.033s              │
│ 8  │ 5.0.0   │ json │ sqlite3 to better sqlite3              │ 0        │ 117       │ 0.018s              │
│ 9  │ 5.0.0   │ code │ strapi public interface                │ 0        │ 126       │ 0.068s              │
│ 10 │ 5.0.0   │ code │ use uid for config namespace           │ 0        │ 126       │ 0.095s              │
│ 11 │ 5.0.0   │ code │ utils public interface                 │ 0        │ 126       │ 0.180s              │
│ 12 │ 5.1.0   │ json │ dependency better sqlite3              │ 1        │ 116       │ 0.021s              │
└────┴─────────┴──────┴────────────────────────────────────────┴──────────┴───────────┴─────────────────────┘
[INFO]  [2025-02-20T10:17:43.524Z] (3/4) Upgrading Strapi dependencies...
[INFO]  [2025-02-20T10:17:43.524Z] (4/4) Installing dependencies...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: test-strapi@0.1.0
npm ERR! Found: @strapi/plugin-users-permissions@4.25.20
npm ERR! node_modules/@strapi/plugin-users-permissions
npm ERR!   @strapi/plugin-users-permissions@"5.10.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! @strapi/plugin-users-permissions@"5.10.3" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @strapi/strapi@5.10.3
npm ERR! node_modules/@strapi/strapi
npm ERR!   peer @strapi/strapi@"^5.0.0" from @strapi/plugin-users-permissions@5.10.3
npm ERR!   node_modules/@strapi/plugin-users-permissions
npm ERR!     @strapi/plugin-users-permissions@"5.10.3" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/claudiomerli/.npm/_logs/2025-02-20T10_17_43_656Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/claudiomerli/.npm/_logs/2025-02-20T10_17_43_656Z-debug-0.log
[ERROR] [2025-02-20T10:17:44.942Z] Command failed with exit code 1: npm install
```
Package.json

```
{
  "name": "test-strapi",
  "private": true,
  "version": "0.1.0",
  "description": "A Strapi application",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "build-prod": "strapi build",
    "strapi": "strapi"
  },
  "dependencies": {
    "@strapi/strapi": "4.25.20",
    "@strapi/plugin-users-permissions": "4.25.20",
    "better-sqlite3": "11.1.2",
    "metadata": "^0.1.0",
    "monaco-editor-webpack-plugin": "^7.1.0",
    "pg": "8.11.3",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-router-dom": "5.3.4",
    "start": "5.1.0",
    "styled-components": "5.3.11",
    "yarn": "1.22.19"
  },
  "author": {
    "name": "A Strapi developer"
  },
  "strapi": {
    "uuid": "a4962c6b-0f97-4eca-a3fb-74274971e418"
  },
  "engines": {
    "node": ">=14.19.1 <=18.x.x",
    "npm": ">=6.0.0"
  },
  "license": "MIT"
}
```


### Steps to Reproduce

1. Create a project with strapi 4.25.20 and @strapi/plugin-users-permissions@4.25.20
2. Try to update 4.25.20

### Expected Behavior

The command completes without errors

### Logs

```shell

```

### Code Snippets

_No response_

### Media

_No response_

### Additional information

_No response_

### Confirmation Checklist

- [x] I have checked the existing [issues](https://github.com/strapi/strapi/issues) for duplicates.
- [x] I agree to follow this project's [Code of Conduct](https://github.com/strapi/strapi/blob/develop/CODE_OF_CONDUCT.md).