Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First step of getting started fails #12

Closed
ramonvanstijn opened this issue Apr 13, 2021 · 3 comments
Closed

First step of getting started fails #12

ramonvanstijn opened this issue Apr 13, 2021 · 3 comments

Comments

@ramonvanstijn
Copy link

The first step of getting started fails:

npx gatsby new my-carbon-site https://github.com/carbon-design-system/gatsby-starter-carbon-theme
info Creating new site from git: https://github.com/carbon-design-system/gatsby-starter-carbon-theme.git

Cloning into 'my-carbon-site'...
remote: Enumerating objects: 133, done.
remote: Counting objects: 100% (133/133), done.
remote: Compressing objects: 100% (124/124), done.
remote: Total 133 (delta 7), reused 79 (delta 1), pack-reused 0
Receiving objects: 100% (133/133), 6.98 MiB | 6.08 MiB/s, done.
success Created starter directory layout
info Installing packages...

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: example@1.28.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"^16.4.2 || ^17.0.0" from gatsby@2.32.12
npm ERR!   node_modules/gatsby
npm ERR!     gatsby@"^2.24.14" from the root project
npm ERR!     peer gatsby@"^2.20.4" from gatsby-theme-carbon@1.28.0
npm ERR!     node_modules/gatsby-theme-carbon
npm ERR!       gatsby-theme-carbon@"^1.28.0" from the root project
npm ERR!   1 more (react-dom)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.13.1" from gatsby-theme-carbon@1.28.0
npm ERR! node_modules/gatsby-theme-carbon
npm ERR!   gatsby-theme-carbon@"^1.28.0" 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! 

 ERROR 

Command failed with exit code 1: npm install



  Error: Command failed with exit code 1: npm install
  
  - error.js:56 makeError
    [6a76b9237e625090]/[gatsby-cli]/[execa]/lib/error.js:56:11
  
  - index.js:114 handlePromise
    [6a76b9237e625090]/[gatsby-cli]/[execa]/index.js:114:26
  
  - task_queues:94 processTicksAndRejections
    node:internal/process/task_queues:94:5
  
  - init-starter.js:135 install
    [6a76b9237e625090]/[gatsby-cli]/lib/init-starter.js:135:7
  
  - init-starter.js:202 clone
    [6a76b9237e625090]/[gatsby-cli]/lib/init-starter.js:202:3
  
  - init-starter.js:343 initStarter
    [6a76b9237e625090]/[gatsby-cli]/lib/init-starter.js:343:5
  
  - create-cli.js:487 
    [6a76b9237e625090]/[gatsby-cli]/lib/create-cli.js:487:9

Please fix.

@vpicone
Copy link
Contributor

vpicone commented Apr 18, 2021

From our slack thread image

@ramonvanstijn
Copy link
Author

@vpicone Both the flag --legacy-peer-deps and --force install the dependencies. However, npm list react returns:

example@1.28.0 /Users/ramonvanstijn/repositories/my-carbon-site
├─┬ gatsby-theme-carbon@1.29.0
│ ├─┬ @carbon/icons-react@10.30.0
│ │ └── react@17.0.1 deduped
│ ├─┬ carbon-components-react@7.33.0
│ │ ├─┬ downshift@5.2.1
│ │ │ └── react@17.0.1 deduped
│ │ ├── react@17.0.1 deduped
│ │ └─┬ use-resize-observer@6.1.0
│ │   └── react@17.0.1 deduped
│ └── react@17.0.1 deduped invalid
└── react@17.0.1 invalid

npm ERR! code ELSPROBLEMS
npm ERR! invalid: react@17.0.1 /Users/ramonvanstijn/repositories/my-carbon-site/node_modules/react

Found a similar unresolved issue: uber/react-digraph#298

@ramonvanstijn
Copy link
Author

As I expected, yarn install has no dependency issues.

The easiest workaround I found so far is to run npm config set legacy-peer-deps true before the npx command. After going through quite a number of similar issues It seems like a matter of time until all dependencies are updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants