strapi-starter-gatsby-blog icon indicating copy to clipboard operation
strapi-starter-gatsby-blog copied to clipboard

error when creating the project using npx

Open muzammilosman opened this issue 2 years ago • 12 comments

Tried creating the project using npx, but there seems to be an error in a dependency

Screenshot 2021-12-23 at 8 29 25 PM

muzammilosman avatar Dec 23 '21 15:12 muzammilosman

Tried creating the project using npx, but there seems to be an error in a dependency

Screenshot 2021-12-23 at 8 29 25 PM

I have the same error.

jeftarmascarenhas avatar Dec 25 '21 01:12 jeftarmascarenhas

same for me with:

node -v: v16.13.1
yarn -v: 1.22.15
npm -v: 8.1.2

StefanoAgazzi avatar Dec 29 '21 00:12 StefanoAgazzi

I have same error, with npx or yarn.

abisai7 avatar Jan 01 '22 01:01 abisai7

Try this command

yarn create strapi-app my-blog --template blog

## or

npx create-strapi-app my-blog --template blog

I found this solution on the repos

jeftarmascarenhas avatar Jan 04 '22 14:01 jeftarmascarenhas

Try this command

yarn create strapi-app my-blog --template blog

## or

npx create-strapi-app my-blog --template blog

I found this solution on the repos

This creates a new project with only the strapi backend, the Gatsby frontend won't be available. Issue still persists for this strapi starter with gatsby

muzammilosman avatar Jan 04 '22 14:01 muzammilosman

I'm also getting the same errors with both npx and yarn.

richlawson avatar Jan 04 '22 21:01 richlawson

Solution here:

https://github.com/strapi/strapi-starter-next-ecommerce/issues/21#issuecomment-986111206

alecandido avatar Jan 09 '22 09:01 alecandido

Just to follow up what @AleCandido kindly linked, to solve it just add a "@3" after create-strapi-starter..

So:

npx create-strapi-starter@3 my-project gatsby-blog

or

yarn create strapi-starter@3 my-project gatsby-blog

Just tested and worked fine.

gfviegas avatar Jan 11 '22 01:01 gfviegas

It fails for me even with v3

Installing strapi/strapi-starter-gatsby-blog starter
- Installing dependencies:This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: Command failed with exit code 1: npm install
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/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.0.0 || ^16.0.0" from [email protected]
npm ERR! node_modules/react-markdown
npm ERR!   react-markdown@"^4.3.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\xxx\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\xxx\AppData\Local\npm-cache\_logs\2022-01-16T00_44_18_057Z-debug-0.log
    at makeError (C:\Users\xxx\AppData\Local\npm-cache\_npx\43e2864cba5bab5b\node_modules\execa\lib\error.js:59:11)
    at handlePromise (C:\Users\xxx\AppData\Local\npm-cache\_npx\43e2864cba5bab5b\node_modules\execa\index.js:114:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async installWithLogs (C:\Users\xxx\AppData\Local\npm-cache\_npx\43e2864cba5bab5b\node_modules\create-strapi-starter\utils\build-starter.js:82:3)
    at async buildStarter (C:\Users\xxx\AppData\Local\npm-cache\_npx\43e2864cba5bab5b\node_modules\create-strapi-starter\utils\build-starter.js:151:3)
\ Installing dependencies:  A complete log of this run can be found in: npm ERR!     C:\Users\xxx\AppData\Local\npm-cache\_logs\2022-01-16T00_44_18_057Z-debug-0.log

[email protected] [email protected]

Ronyo avatar Jan 16 '22 01:01 Ronyo

Just to follow up what @AleCandido kindly linked, to solve it just add a "@3" after create-strapi-starter..

So:

npx create-strapi-starter@3 my-project gatsby-blog

or

yarn create strapi-starter@3 my-project gatsby-blog

Just tested and worked fine.

npx works, but yarn doesn't... ;/

aimeetacchi avatar Jan 31 '22 22:01 aimeetacchi

@aimeetacchi which versions of npm and node did you use?

Ronyo avatar Feb 06 '22 05:02 Ronyo

Dont forget to switch to node 14

aaegorof avatar Mar 15 '22 11:03 aaegorof