Pomoc przy błędzie

0

Błąd na stronie:

Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.json': Cannot find module 'typescript'
Require stack:

  • C:\Users\impos\netflix\node_modules\@typescript-eslint\parser\node_modules\@typescript-eslint\typescript-estree\dist\parser.js
  • C:\Users\impos\netflix\node_modules\@typescript-eslint\parser\node_modules\@typescript-eslint\typescript-estree\dist\index.js
  • C:\Users\impos\netflix\node_modules\@typescript-eslint\parser\dist\parser.js
  • C:\Users\impos\netflix\node_modules\@typescript-eslint\parser\dist\index.js
  • C:\Users\impos\netflix\node_modules\@eslint\eslintrc\lib\config-array-factory.js
  • C:\Users\impos\netflix\node_modules\@eslint\eslintrc\lib\index.js
  • C:\Users\impos\netflix\node_modules\eslint\lib\cli-engine\cli-engine.js
  • C:\Users\impos\netflix\node_modules\eslint\lib\cli-engine\index.js
  • C:\Users\impos\netflix\node_modules\eslint\lib\api.js
  • C:\Users\impos\netflix\node_modules\eslint-webpack-plugin\dist\worker.js
  • C:\Users\impos\netflix\node_modules\jest-worker\build\workers\threadChild.js>

package.json:

{
  "name": "netflix",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/user-event": "^12.1.10",
    "firebase": "^8.2.3",
    "fuse.js": "^6.4.6",
    "normalize.css": "^8.0.1",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.1",
    "style-component": "^0.0.1",
    "styled-components": "^5.2.1",
    "web-vitals": "^0.2.4"
  },
  "devDependencies": {
    "@testing-library/react": "^11.1.0",
    "@typescript-eslint/eslint-plugin": "^4.14.0",
    "@typescript-eslint/parser": "^4.14.0",
    "eslint": "^7.18.0",
    "eslint-config-standard": "^16.0.2",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-react": "^7.22.0"
  },
  "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"
    ]
  }
}

.eslintrc.json:

{
    "env": {
        "browser": true,
        "es2021": true
    },
    "extends": [
        "plugin:react/recommended",
        "standard"
    ],
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "ecmaFeatures": {
            "jsx": true
        },
        "ecmaVersion": 12,
        "sourceType": "module"
    },
    "plugins": [
        "react",
        "@typescript-eslint"
    ],
    "rules": {
    }
}

PC: Windows 10

0

Nie masz zainstalowanego Typescripta
npm install typescript --save-dev

1 użytkowników online, w tym zalogowanych: 0, gości: 1, botów: 0