I am trying to build SPFX(React Framework) with Fluent UI. I am not able import any Fluent UI components. VS code failed to build with error : Cannot find module '@fluentui/react' enter image description here

  • Have you tried npm i @fluentui/react-components
    – Saira
    Aug 23, 2022 at 22:41
  • Which version of SPFx / Node.js are you using? Also, try running npm i @fluentui/react command before building the web part. Let us know if it works. Aug 24, 2022 at 4:02
  • Node JS is 10.24(as per Microsoft recommendation)
    – mzonerz
    Aug 24, 2022 at 8:08
  • @Saira Yes, It had already done
    – mzonerz
    Aug 24, 2022 at 8:16

3 Answers 3


Please run below cmdlet

npm install @fluentui/react

And you will get following enter image description here

  • I had this added already..but did not work.
    – mzonerz
    Aug 24, 2022 at 8:07

Install "office-ui-fabric-react": "^6.189.2" and use 'office-ui-fabric-react" instead of '@fluentui/react'

  • I need to use Fluent UI.
    – mzonerz
    Aug 24, 2022 at 8:09
  • Fabric ui is same as fluent ui but an older version Aug 25, 2022 at 9:02
  • thats why I dont want to use. thank you :)
    – mzonerz
    Aug 25, 2022 at 10:49

This is a limitation of SPFx v1.4.1. Solution generator referenced to older version of packages which not compatible with FluentUI (you have to use office-ui-fabric-core). Below definitive guide describes it well.

Definitive Guide:


Workaround to use FluentUI in SPFX 1.4.1:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.