'Error: Cannot find module 'C:\XXX\XXX/config-overrides'

I have created a sample react/redux/.net core app by using this Tutorial. But when I try to start the application with npm start I get the 'cannot find module error'.

I have tried to clean the app by running the following commands:

  • npm cache clean --force
  • rm -rf node_modules
  • npm install

But with no success.

package.json

    {
  "name": "DCRRWebApplication",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "bootstrap": "^4.1.3",
    "jquery": "3.3.1",
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
    "react-redux": "^6.0.0",
    "react-router-bootstrap": "^0.24.4",
    "react-router-dom": "^4.2.2",
    "react-router-redux": "^5.0.0-alpha.8",
    "react-scripts": "^2.1.5",
    "reactstrap": "^7.1.0",
    "redux": "^4.0.1",
    "redux-thunk": "^2.2.0",
    "rimraf": "^2.6.2"
  },
  "devDependencies": {
    "ajv": "^6.0.0",
    "babel-eslint": "^10.0.1",
    "cross-env": "^5.2.0",
    "eslint": "^5.13.0",
    "eslint-config-react-app": "^3.0.7",
    "eslint-plugin-flowtype": "^3.4.1",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.2.1",
    "eslint-plugin-react": "^7.11.1",
    "react-app-rewire-yaml": "^1.1.0",
    "react-app-rewired": "^2.1.0",
    "react-scripts-ts": "^4.0.8"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "scripts": {
    "start": "rimraf ./build && react-app-rewired start --scripts-version react-scripts-ts",
    "build": "react-app-rewired build --scripts-version react-scripts-ts",
    "test": "react-app-rewired test --scripts-version react-scripts-ts --env=jsdom",
    "eject": "react-scripts eject",
    "lint": "eslint ./src/"
  }
}


Solution 1:[1]

The error is often associated with the config-overrides.js not being in the root folder. This config is expected by react-app-rewired.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gibron