Skip to content

Unable start project: Cannot find module '@svgr/webpack' #13734

@yhojann-cl

Description

@yhojann-cl

I try create a new project using npx create-react-app but is broken, i try reutilize a old project created 1 month ago and i delete the node_modules folder and package-lock.json, and execute npm install, its works fine but when try run the project says an error:

$ npm start

> web-app@0.1.0-beta start
> react-scripts start

Cannot find module '@svgr/webpack'
Require stack:
- /home/.../webapp/node_modules/react-scripts/config/webpack.config.js
- /home/.../webapp/node_modules/react-scripts/scripts/start.js

I try install mannualy the package using npm install @svgr/webpack but does not work. The package.json file content is:

{
  "name": "web-app",
  "version": "0.1.0-beta",
  "description": "WEB App",
  "homepage": "./",
  "dependencies": {
    "@svgr/webpack": "^8.1.0",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "bootstrap": "^5.3.3",
    "bootstrap-icons": "^1.11.3",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-markdown": "^9.0.1",
    "react-scripts": "5.0.1",
    "url": "^0.11.3",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Can not create a new project and can not run any project.

My software version:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.1 LTS
Release:	24.04
Codename:	noble

$ node --version
v22.12.0

$ npm --version
10.9.0

I try use node 18 and 22 but does not work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions