microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.52k stars 2.73k forks source link

[Bug]: npm install command is failing latest react version #24365

Closed SubbaReddi closed 1 year ago

SubbaReddi commented 2 years ago

Library

React Northstar / v0 (@fluentui/react-northstar)

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Memory: 8.07 GB / 15.90 GB
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.54)
    Internet Explorer: 11.0.19041.1566

Are you reporting Accessibility issue?

no

Reproduction

Add React- Typescript app to .Net core solution and run following command: npm install @fluentui/react-northstar

Bug Description

Actual Behavior

npm install @fluentui/react or npm install @fluentui/react-northstar is failing and showing below error:

npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: clientapp@0.1.0 npm ERR! Found: @types/react@18.0.17 npm ERR! node_modules/@types/react npm ERR! @types/react@"^18.0.17" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @types/react@">=16.8.0 <18.0.0" from @fluentui/react@8.87.2 npm ERR! node_modules/@fluentui/react npm ERR! @fluentui/react@"*" 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\v-sutumm\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\v-sutumm\AppData\Local\npm-cache_logs\2022-08-14T17_35_07_943Z-debug-0.log

Expected Behavior

It should install fluent react without errors

Logs

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: clientapp@0.1.0
npm ERR! Found: @types/react@18.0.17
npm ERR! node_modules/@types/react
npm ERR!   @types/react@"^18.0.17" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @types/react@">=16.8.0 <18.0.0" from @fluentui/react@8.87.2
npm ERR! node_modules/@fluentui/react
npm ERR!   @fluentui/react@"*" 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\v-sutumm\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\v-sutumm\AppData\Local\npm-cache\_logs\2022-08-14T17_35_07_943Z-debug-0.log

Requested priority

High

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

layershifter commented 2 years ago

@fluentui/react-northstar does not support React 18, please downgrade @types/react to 17.* in your project (currently @types/react@18.0.17). Another option is to use --legacy-peer-deps to skip that check.

kevinfairclough commented 2 years ago

Same error for @fluent/react 8.88.0

layershifter commented 2 years ago

Same error for @fluent/react 8.88.0

https://github.com/microsoft/fluentui/issues/24365#issuecomment-1214740350, the same is true for @fluentui/react. Check #22241 for more details.

msft-fluent-ui-bot commented 1 year ago

Because this issue has not had activity for over 180 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.