Rediger

Yeoman generator for the SharePoint Framework

The SharePoint Online SPFx Yeoman Generator helps you quickly create a SharePoint client-side solution project with the right toolchain and project structure. It's used along with Yeoman to prompt you with questions to create the project scaffolding (the folders & files).

Important

This page assumes you've already installed all the necessary prerequisites for developing SharePoint Framework solutions. Verify the updated instructions outlined in the page Set up your SharePoint Framework development environment.

For SPFx 1.24, use Node.js 26 LTS and the 1.24.1 generator. Generated projects use Heft, TypeScript 5.8, and, for React templates, React 18.3.1. See the compatibility reference for supported alternatives and requirements for older releases.

The SharePoint Online SPFx Yeoman Generator (the "SPFx generator"), uses the responses to the questions the developer is prompted with to create a new SharePoint Framework (SPFx) project. Depending on some prompt responses, other questions are presented.

For example, if you select the WebPart component type, you'll only see questions for the web part name and template type. However, if you select the Extension component type, you'll also be prompted for the type of extension such as application customizer, field customizer, or ListView command set.

The following historical SPFx 1.22.1 output illustrates creating a solution named sfpxplay-01 with a HelloWorld web part and the Minimal template. File names and dependencies can differ in later versions; use the files generated by your selected version:

yo @microsoft/sharepoint --skip-install

     _-----_     ╭──────────────────────────╮
    |       |    │ Welcome to the Microsoft │
    |--(o)--|    │      365 SPFx Yeoman     │
   `---------´   │     Generator@1.22.1     │
    ( _´U`_ )    ╰──────────────────────────╯
    /___A___\   /
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

See https://aka.ms/spfx-yeoman-info for more information on how to use this generator.
Let's create a new Microsoft 365 solution.
? What is your solution name? sfpxplay-01
? Which type of client-side component to create? WebPart
Add new Web part to solution sfpxplay-01.
? What is your Web part name? HelloWorld
? Which template would you like to use? Minimal

   create package.json
    force .yo-rc.json
   create config/package-solution.json
   create config/config.json
   create config/serve.json
    force .vscode/settings.json
   create config/deploy-azure-storage.json
   create config/write-manifests.json
    force .gitignore
   create .vscode/launch.json
   create config/rig.json
   create config/sass.json
   create config/typescript.json
    force README.md
   create .npmignore
   create tsconfig.json
   create .eslintrc.js
   create src/webparts/helloWorld/loc/en-us.js
   create src/webparts/helloWorld/loc/mystrings.d.ts
   create src/webparts/helloWorld/HelloWorldWebPart.module.scss
   create src/webparts/helloWorld/HelloWorldWebPart.ts
   create src/webparts/helloWorld/HelloWorldWebPart.manifest.json
   create teams/dc72706f-d2d2-4bd6-ba48-a05d65ba5fc6_outline.png
   create teams/dc72706f-d2d2-4bd6-ba48-a05d65ba5fc6_color.png


Changes to package.json were detected.
Skipping package manager install.

      _=+#####!
   ###########|       .--------------------------------------.
   ###/    (##|(@)    |           Congratulations!           |
   ###  ######|   \   |   Solution sfpxplay-01 is created.   |
   ###/   /###|   (@) |  Run npm run start to play with it!  |
   #######  ##|   /   '--------------------------------------'
   ###     /##|(@)
   ###########|
      **=+####!

Tip

The different component types and options are addressed throughout the documentation in this site. Every option isn't covered on this page. For more information about the details on each component type, see the relevant topics throughout the documentation.

If you use --skip-install, run npm install before running the project. For web parts, replace generated Online workbench URLs in config/serve.json and .vscode/launch.json with an actual development page. Follow debugging on modern SharePoint pages and use the developer toolbar.

Important

The SharePoint Framework Online workbench is deprecated starting on May 13, 2026 and will be retired on December 1, 2026.

For web parts, debug on actual SharePoint pages using the SharePoint Framework Debug Toolbar (developer toolbar). See Debug SharePoint Framework solutions on modern SharePoint pages.

This deprecation does not apply to the Copilot Workbench, which is fully supported for developing and testing Copilot UX components.

Install the SharePoint Online SPFx Yeoman Generator

The SPFx generator is available as an npm package. Install the SPFx 1.24.1 generator:

npm install @microsoft/generator-sharepoint@1.24.1 --global

To use another release, specify its version after @ and select its supported Node.js environment first. For example, the following command is for a legacy SPFx 1.10 project, not a new SharePoint Online project:

npm install @microsoft/generator-sharepoint@1.10 -g

Minimal project template

A new project template option, Minimal, was added to the SPFx generator in SPFx v1.14. This project template option includes no theme or host environment code in new projects.

For example, a new web part project starts with the following code, representing the minimal code necessary to run the web part:

export default class HelloWorldWebPart
  extends BaseClientSideWebPart<IHelloWorldWebPartProps> {

  public render(): void {
    this.domElement.innerHTML = `<div class="${ styles.helloWorld }"></div>`;
  }

  protected onInit(): Promise<void> {
    return super.onInit();
  }

  protected get dataVersion(): Version {
    return Version.parse('1.0');
  }
}

Retired generator prompts

With each release of the SharePoint Framework, prompts may be added or removed in the Yeoman generator. Prompts were removed to simplify the project creation experience.

In the following section, you'll find the retired prompts with applicable guidance.

Target different SharePoint Environments

In the SPFx v1.13 release, the following prompt was retired:

Which baseline packages do you want to target for your component(s)?

This prompt presented the developer with the option to create a project that targeted specific SharePoint deployments, including:

  • SharePoint Online only (latest)
  • SharePoint 2016 onwards, including 2019 and SharePoint Online
  • SharePoint 2019 onwards, including SharePoint Online

Starting with SPFx v1.13, the generator can only create projects for SharePoint Online.

Skip feature deployment - skipFeatureDeployment

In the SPFx v1.14 release, the following prompt was retired:

Do you want to allow the tenant admin the choice of being able to deploy the solution to all sites immediately without running any feature deployment or adding apps in sites?

This question is asking if the solution should be automatically installed for all sites in the tenant, or should it be manually installed in each site? The default option was [N]o.

The outcome of this question was set on the skipFeatureDeployment property in the project's ./config/package-solution.json file.

Starting with SPFx v1.14, the skipFeatureDeployment property defaults to true. You can change the value of this property after creating the project, if necessary.

Domain isolated web parts - isDomainIsolated

In the SPFx v1.14 release, the following prompt was retired:

Will the components in the solution require permissions to access web APIs that are unique and not shared with other components in the tenant?

This question is asking if the web parts within the solution should be rendered within an <iframe> in a unique domain, or in a DIV as the current page. The default option was [N]o.

Note

Learn more about this prompt: Isolated web parts

The outcome of this question was set on the isDomainIsolated property in the project's ./config/package-solution.json file.

Starting with SPFx v1.14, the isDomainIsolated property defaults to false. Domain-isolated web parts were retired in SharePoint Online on April 2, 2026; don't enable this setting for new solutions. See Isolated web part retirement. This retired feature is separate from Copilot UX component iframe hosting.

Which framework would you like to use?

In the SPFx v1.14 release, the following prompt was changed:

Which framework would you like to use?

This prompt was displayed for specific project types, such as web parts & types of SPFx extensions. It enabled developers to select from different project templates: No JavaScript framework or React.

The default project scaffolding created by the Yeoman generator was determined using the option selected.

In SPFx v1.14, this prompt was changed to the following and presented the user with three choices: Minimal, No framework, or React:

Which template would you like to use?

Component descriptions

In the SPFx v1.14 release, the following prompts were retired:

What is your Web part description?

What is your Application Customizer description?

What is your Field Customizer description?

What is your ListView Command Set description?

What is your Library description?

What is your Adaptive Card Extension description?

The values of these prompts were set on the preConfiguredEntries[0].description.default & preConfiguredEntries[0].properties.description properties in the component's *.manifest.json file.

Starting with SPFx v1.14, these properties are set to empty strings. You can change the value of these properties after creating the project, if necessary.

SPFx generator command line options

You can use the SPFx generator's command-line options to create projects in one command instead of going through the prompts. Execute the following command to see the list of command-line options available for the SharePoint generator:

yo @microsoft/sharepoint --help