0

I was trying to start a project with 'npx create-react-app'.
However,
@types/eslint v8.4.4 missing from NPM registry same Error

so i tried 'npx create-react-app@5.0.1 test --template typescript --ignore-existing'
I solved the problem with that command, but another problem occurred

I typed the npm start command in vscode and an error as shown in the picture occurred. error

So I put the following code in package.json.

{
  "name": "test",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.5.2",
    "@types/node": "^16.11.42",
    "@types/react": "^18.0.14",
    "@types/react-dom": "^18.0.5",
    "gh-pages": "^4.0.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-helmet": "^6.1.0",
    "react-query": "^3.39.1",
    "react-router-dom": "^5.3.0",
    "react-scripts": "5.0.1",
    "recoil": "^0.7.4",
    "styled-components": "^5.3.5",
    "typescript": "^4.7.4",
    "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"
    ]
  },
  "devDependencies": {
    "@types/eslint": "^8.4.3",
    "@types/react-helmet": "^6.1.5",
    "@types/react-router-dom": "^5.3.3",
    "@types/styled-components": "^5.1.25"
  },
  "overrides": {  
    "@types/eslint": "8.4.3"
  }
}

And Installed

  1. npm i @types/eslint@8.4.3
  2. npm i -D @types/eslint@8.4.3

But I keep getting an error like the picture...

npm v8.5.5 node v16.15.0

  • You don't have to remove the content of package.json when adding overrides. You probably replaced everything with what you wrote. You just have to add that override thing before the ending `}`. – brc-dd Jul 01 '22 at 13:06
  • I didn't delete the content of package.json, I just added it at the end – wannabeing Jul 01 '22 at 13:11
  • Can you add your `package.json` as it is in the post? You probably missed a comma or something like that. – brc-dd Jul 01 '22 at 13:11
  • Okay. I uploaded it, please check it! – wannabeing Jul 01 '22 at 13:14
  • Please revise your post title to ask a clear, specific question. See [ask] and take the [tour]. – isherwood Jul 01 '22 at 13:17
  • Is the file saved? Because in the screenshot that you've attached I am seeing `resolutions` at line 1. Also `resolutions` is for Yarn, for NPM you need `overrides`. – brc-dd Jul 01 '22 at 13:19
  • yes saved. And I'm using npm and since it's 8.5.5 I changed it to `overrides` but I get the same error – wannabeing Jul 01 '22 at 13:31
  • I solved it! There was a package.json file outside the project :( Thank you for your help!! – wannabeing Jul 01 '22 at 20:44

0 Answers0