Updating the Yeoman template version

Yeoman generator, which you installed after Node.js and npm, tends to get frequent updates from Microsoft. When developing for SharePoint Online using the SharePoint Framework, you should always choose the latest stable Yeoman templates by running the following command:

npm install -g @microsoft/generator-sharepoint 

This pulls in the latest version from https://www.npmjs.com/package/@microsoft/generator-sharepoint and installs the necessary templates.

To verify the current version of Yeoman templates, use the following command:

npm list -g | find "sharepoint" 

This should print out the version number. At the time of writing this book, the latest version was 1.2.0:

If, however, you are aiming to create the SharePoint Framework solutions for SharePoint 2016 that together with SharePoint Feature Pack 2 (FP2) provides limited support for SPFx, you may need to switch to a different version corresponding to the version of the Yeoman templates.

First, you'll need to verify which version of Yeoman templates is supported at the time of installation. This might very well be the latest version, thus, no action is needed. It might also be a different version from SharePoint Online's required version, which presumably is the latest stable version.

Before switching to the Yeoman template version, you will need to uninstall the currently installed version with the following command:

npm uninstall  -g @microsoft/generator-sharepoint 

Next, you can install a specific version of Yeoman template by specifying the exact version with the following syntax:

npm install -g @microsoft/[email protected] 

The 1.02 stands for version, and at the time of writing, this is the version that is supported with SharePoint 2016 Feature Pack 2. For SharePoint Online, you should always go with the latest version--at the time of writing, this was 1.2.0.

After installing an older version, you can once again verify your currently installed version with the following command:

npm list -g | find "sharepoint" 

This should print out the specific version, such as @microsoft/[email protected].

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.14.219