Getting error trying to install latest versions of React, Next and Polaris

Mustavanov
New Member
2 0 0

I'm trying to create a sample app using this article provided by Shopify from Shopify Build App Tutorial

but when I reached the point to install Polaris I faced this problem in my vs.code 

when I run:

npm install --save @shopify/polaris webpack@4

 

I get this error:
I think it's related to versions

 

 

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: simple-shopify-app@1.0.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.9.0" from /polaris@6.5.0
npm ERR! node_modules/@shopify/polaris
npm ERR!   /polaris@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\iSmail\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\iSmail\AppData\Local\npm-cache\_logs\2021-06-16T21_55_34_554Z-debug.log

 

 

and this is my "package.json" file code: 

 

 

 

 

{
  "name": "simple-shopify-app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "node server.js",
    "build": "next build",
    "start": "NODE_ENV=production node server.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@shopify/koa-shopify-auth": "^4.1.3",
    "@shopify/koa-shopify-graphql-proxy": "^5.0.0",
    "@shopify/shopify-api": "^1.4.1",
    "dotenv": "^10.0.0",
    "isomorphic-fetch": "^3.0.0",
    "koa": "^2.13.1",
    "koa-router": "^8.0.8",
    "koa-session": "^6.2.0",
    "next": "^11.0.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2"
  }
}

 

 

 

Please help me fix this and install Polaris on my project correctly!

Thank You!

 

0 Likes