13

I got this project from a repo cloned it using

git clone

then cd into the correct directory

Example: Example

Next i went to install the project and this error comes up

enter image description here

Here is the JSON file

{
  "name": "tryb-prints",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event": "^7.2.1",
    "atomize": "^1.0.26",
    "bootstrap": "^4.5.3",
    "firebase": "^8.0.2",
    "materialize-css": "^1.0.0-rc.2",
    "react": "^17.0.1",
    "react-bootstrap": "^1.4.0",
    "react-dom": "^17.0.1",
    "react-router-bootstrap": "^0.25.0",
    "react-router-dom": "^5.2.0",
    "react-scripts": "3.4.4",
    "react-transition-group": "^4.4.1",
    "semantic-ui-css": "^2.4.1",
    "semantic-ui-react": "^2.0.1",
    "shopify-buy": "^2.11.0",
    "styletron-engine-atomic": "^1.4.6",
    "styletron-react": "^5.2.7"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

any help at all would be apricated

Dan Bonachea
  • 2,408
  • 5
  • 16
  • 31
Cathal
  • 171
  • 1
  • 1
  • 8

4 Answers4

41

try with npm install --legacy-peer-deps

Laaouatni Anas
  • 4,199
  • 2
  • 7
  • 26
4

Using npm install --legacy-peer-deps allows you to get passed those errors.

Laaouatni Anas
  • 4,199
  • 2
  • 7
  • 26
Stephen
  • 41
  • 2
2

Because some of your inner dependency is forcing react ^16.8 you cant use version 17+.

Downgrade to anything below major version 17 and you are good to go

Lukas Cizek
  • 190
  • 6
  • Do i just need to downgrade react version or change in json file – Cathal Mar 18 '21 at 21:09
  • Hey Cathal. It depends. I would just go for changing it in package json (remove the ^ for a second), install and put the ^ back. That should be the safest and quick – Lukas Cizek Mar 19 '21 at 21:10
2

this worked for me

npm install --force
  • Thanks for posting, I was facing a similar issue with npm and I'm glad I saw your post. This definitely worked for me! – user2367924 Oct 14 '22 at 15:50