The SharePoint Framework Yeoman Generator is expected to continue to improve as Microsoft pushes changes to the Framework. As of the publish date of this post, we are up to code drop 6 (January 2017), which is in developer preview, but even once the Framework goes to GA, it is expected to continue on its evolutionary path with future updates.
To keep up to date, we need to ensure that our local development Yeoman generator also stays up to date. All we need to do is run “npm update” on the Yeoman generator and we are set at least on a global scale within our workstation. Your existing projects may need additional assistance for upgrading, but at least the generator will be up to date.
Update your SharePoint Framework Yeoman generator
You may run this command as often as you want, if there is no update, the command simply returns nothing.
C:\> npm update -g @microsoft/generator-sharepoint@latest
Check your SharePoint Framework Yeoman generator version
There are two methods I use to determine the current version of the Framework Yeoman generator, one checks the publicly available package, while a second is useful to determine what is currently installed on your workstation.
“npm view” returns information about the public package, by default the latest version. The “version” specifies we want to return the version field.
C:\> npm view @microsoft/generator-sharepoint version
“npm list” provides us information regarding the installed package on our workstation. The -g options specifies that we want information on the globally installed package.
C:\> npm list -g @microsoft/generator-sharepoint
In the example output below, I updated to the latest SharePoint Framework Yeoman Generator, then using both suggested commands to review the generator version number, I can see I have version 0.3.2 installed, which is the correct version as of Code Drop 6.