Home Upgrading Your SharePoint Framework (SPFx) Project
Post
Cancel

Upgrading Your SharePoint Framework (SPFx) Project

Upgrading Your SharePoint Framework (SPFx) Project to the Latest Version: Using M365 CLI

  1. Install Microsoft 365 CLI globally
    1
    
    npm install -g @microsoft/365-cli
    
  2. Run the following command to get report on the upgrade process
    1
    
    m365 spfx project upgrade --toVersion 1.14.0 --output md > "upgrade-report.md"
    
  3. Open the report file and review the changes that will be applied to your project
    1
    
    notepad upgrade-report.md
    
  4. under summary section, you will see the list of changes that will be applied to your project. If you are happy with the changes, run the following command to apply the changes

    Issues i encountered

  5. Dublicate packages in package.json like:
1
2
    "@microsoft/rush-stack-compiler-3.9": "0.4.48",
    "@microsoft/rush-stack-compiler-4.5": "0.2.2",

dublicates

i just removed the older version and kept the latest one.

Conclusion

In this post, we have seen how to upgrade your SharePoint Framework (SPFx) project to the latest version using M365 CLI. I hope you found this post useful. If you have any questions, please feel free to leave a comment below.

This post is licensed under CC BY 4.0 by the author.

Tip of the day. Use enhanced Sharepoint formatter

Tip Of The Day. SharePoint debug console by using Ctrl+f12