Skip to content

[bug]: Unable to install @strapi/sdk-plugin to extend ui components to Strapi admin #122

@Leap-Chanvuthy

Description

@Leap-Chanvuthy

What version of @strapi/sdk-plugin are you using?

Node Version
v20.20.2

Package Manager
npm

Package Manager Version
11.11.0

Strapi Version
5.40.0

Operating System
MacOS

Database
PostgreSQL

Javascript or Typescript
Typescript

Reproduction URL
N/A

What's Wrong?

I am unable to successfully install and scaffold a custom UI plugin using @strapi/sdk-plugin in my Strapi v5 project.

When running the plugin generator command:

npx @strapi/sdk-plugin@latest init google-analytics-widget

The plugin is scaffolded correctly into the /src/plugins directory, but the installation step (npm install) fails with dependency resolution errors related to TypeScript version conflicts.

The main error is:

npm ERR! ERESOLVE could not resolve

While resolving: react-intl@6.8.9
Found: typescript@6.0.2

Could not resolve dependency:
peerOptional typescript@"^4.7 || 5" from react-intl@6.8.9

This prevents the plugin installation from completing successfully.

To Reproduce

🔁 Steps to Reproduce
Create a Strapi v5 project
Use the following environment:
Node.js v20.20.2
npm v11.11.0

Run:

npx @strapi/sdk-plugin@latest init google-analytics-widget
Fill in plugin details and select TypeScript
Wait for the automatic npm install step
Observe dependency resolution failure (ERESOLVE)
✅ Expected Behavior
Plugin should scaffold successfully
Dependencies should install without conflict
Plugin should be usable immediately in the Strapi admin panel

📋 Logs
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve

While resolving: react-intl@6.8.9
Found: typescript@6.0.2

Could not resolve dependency:
peerOptional typescript@"^4.7 || 5" from react-intl@6.8.9
ℹ️ Additional Information
Running npm ls typescript shows multiple TypeScript versions installed (5.x and 6.x)
Strapi dependencies appear to rely on TypeScript 5.x
The plugin generator seems to introduce or resolve TypeScript to 6.x during installation
Using --legacy-peer-deps allows installation to complete, but this is not ideal for production stability

Expected Behaviour

❌ Actual Behavior
Plugin scaffold completes
npm install fails due to TypeScript peer dependency conflict
Installation process exits with error
Plugin is generated but may not work correctly due to incomplete dependency setup

📦 package.json

{
  "name": "cms-cadt",
  "version": "0.1.0",
  "private": true,
  "description": "A Strapi application",
  "scripts": {
    "build": "strapi build",
    "console": "strapi console",
    "deploy": "strapi deploy",
    "dev": "strapi develop",
    "develop": "strapi develop",
    "seed": "node ./scripts/seed-manual.js",
    "seed:example": "node ./scripts/seed.js",
    "seed:one": "node ./scripts/run-seed.js",
    "start": "strapi start",
    "strapi": "strapi",
    "upgrade": "npx @strapi/upgrade latest",
    "upgrade:dry": "npx @strapi/upgrade latest --dry"
  },
  "dependencies": {
    "@google-analytics/data": "^5.2.1",
    "@strapi/plugin-cloud": "5.40.0",
    "@strapi/plugin-documentation": "^5.38.0",
    "@strapi/plugin-graphql": "^5.38.0",
    "@strapi/plugin-users-permissions": "5.40.0",
    "@strapi/strapi": "5.40.0",
    "esbuild": "^0.27.4",
    "fs-extra": "^10.0.0",
    "mime-types": "^2.1.27",
    "pg": "8.8.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-router-dom": "^6.0.0",
    "styled-components": "^6.0.0"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "typescript": "^5"
  },
  "engines": {
    "node": ">=20.0.0 <=24.x.x",
    "npm": ">=6.0.0"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugIssue reporting a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions