Getting an error during the dependency installation of Strapi installation process
Asked Answered
T

3

6

recently I tried to install Strapi to my windows computer using "npx". But I'm getting an error when the dependencies get updated as below.I tried to uninstall and install knex but it didn't work. How can i solve tthis problem?

strapi-app>npx create-strapi-app . --quickstart
Creating a new Strapi application at D:\E-LEARNING\React Js\projects\strapi-app.

Creating a quickstart project.
Creating files.
Error while installing dependencies:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/knex
npm ERR!   knex@"<0.20.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer knex@"^0.20.0" from [email protected]
npm ERR! node_modules/strapi-connector-bookshelf
npm ERR!   strapi-connector-bookshelf@"3.4.1" 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\user\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\user\AppData\Local\npm-cache\_logs\2021-01-12T10_28_05_191Z-debug.log

 Keep trying!

Oh, it seems that you encountered errors while installing dependencies in your project.
Don't give up, your project was created correctly.
Fix the issues mentionned in the installation errors and try to run the following command:

cd D:\E-LEARNING\React Js\projects\strapi-app && npm install

npm ERR! code 1
npm ERR! path D:\E-LEARNING\React Js\projects\strapi-app
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c create-strapi-app . --quickstart

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2021-01-12T10_28_07_219Z-debug.log
Tafilelt answered 12/1, 2021 at 10:57 Comment(1)
What is the version of node.js installed on your computer?Divulsion
S
2

Strapi apparently only supports Node v14 (current LTS). Switch to that version (NVM?) and try again.

Scutch answered 2/2, 2021 at 13:58 Comment(1)
I'm my local I have Node v14.5.0 and I'm getting the same error as op.Gubernatorial
M
1

I had the same problem when deploying to heroku. It worked by changing the npm version from >=6.0.0 to 6.14.9 in package.json:

  "engines": {
    "node": ">=10.16.0 <=14.x.x",
    "npm": "6.14.9"
  }
Masque answered 2/2, 2021 at 21:52 Comment(0)
O
0

I change my nodeJS engine version to v14 like this and it worked :

  "engines": {
    "node": "14.x",
    "npm": "6.x"
  },

Source : the recommanded version is 12 at least, but 14 recommanded https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/installation/cli.html#step-1-make-sure-requirements-are-met

Obala answered 20/3, 2021 at 20:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.