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

[Bug]: Next.js : Failed to install with CLI #14027

Closed
okakyo opened this issue Feb 23, 2021 · 4 comments
Closed

[Bug]: Next.js : Failed to install with CLI #14027

okakyo opened this issue Feb 23, 2021 · 4 comments

Comments

@okakyo
Copy link

okakyo commented Feb 23, 2021

Describe the bug

I tried to run the init script, npx sb init in a Next.js project, but I got the error: unable to resolve dependency tree

To Reproduce

In the Envrironment:

  • Windows 10 Pro: 1909
  • Node : v14.10.1
  • npm : 7.5.2
  1. Create a Next.js project with CLI: npx create-next-app sample-project
  • next: "10.0.7",
  • react: "17.0.1"
  • react-dom: "17.0.1"
  1. Move to the Next.js project: cd sample-project,
  2. Run the script: npx sb init
  3. An error occurred:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   peerOptional react@"^16.8.0 || ^17.0.0" from @storybook/addon-actions@6.1.19
npm ERR!   node_modules/@storybook/addon-actions
npm ERR!     dev @storybook/addon-actions@"^6.1.19" from the root project
npm ERR!     @storybook/addon-actions@"6.1.19" from @storybook/addon-essentials@6.1.19
npm ERR!     node_modules/@storybook/addon-essentials
npm ERR!       dev @storybook/addon-essentials@"^6.1.19" from the root project
npm ERR!   peerOptional react@"^16.8.0 || ^17.0.0" from @storybook/addon-essentials@6.1.19
npm ERR!   node_modules/@storybook/addon-essentials
npm ERR!     dev @storybook/addon-essentials@"^6.1.19" from the root project
npm ERR!   8 more (@storybook/addon-links, @storybook/react, react-dom, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.4" from react-inspector@5.1.0
npm ERR! node_modules/@storybook/addon-actions/node_modules/react-inspector
npm ERR!   react-inspector@"^5.0.1" from @storybook/addon-actions@6.1.19
npm ERR!   node_modules/@storybook/addon-actions
npm ERR!     dev @storybook/addon-actions@"^6.1.19" from the root project
npm ERR!     1 more (@storybook/addon-essentials)
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\0622o\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\0622o\AppData\Local\npm-cache\_logs\2021-02-23T12_35_12_009Z-debug.log
An error occurred while installing dependencies.

npm ERR! code 1
npm ERR! path C:\Users\0622o\projects\conoha-app\nest-app
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c sb init

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\0622o\AppData\Local\npm-cache\_logs\2021-02-23T12_35_12_130Z-debug.log

Expected behavior
I think the bug may solved by upgrading the version in the CLI's React library.

@okakyo okakyo changed the title [Bug] Next.js : unable to resolve dependency tree when installing with npm [Bug]: Next.js : unable to resolve dependency tree when installing with CLI Feb 23, 2021
@okakyo okakyo changed the title [Bug]: Next.js : unable to resolve dependency tree when installing with CLI [Bug]: Next.js : Failed to install with CLI Feb 23, 2021
@webistomin
Copy link

Same issue for vue.js app

@shilman shilman added the P0 label Feb 24, 2021
@shilman
Copy link
Member

shilman commented Feb 24, 2021

@webistomin are you also on windows?

@shilman
Copy link
Member

shilman commented Feb 24, 2021

I think a workaround is

npx --legacy-peer-deps sb init

@shilman
Copy link
Member

shilman commented Feb 24, 2021

closing as dupe to #12983

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

No branches or pull requests

3 participants