How to: Check the currently installed SPFx version

So, while working through the SPFx tutorial at docs.microsoft.com, I noticed a word of caution saying that, for that particular lab, I needed to have version 1.10 at least. Great, I thought. I had just put my development environment together recently, I obviously had one of the latest versions. Still though, which one?

What was the issue

I needed to know which SPFx version was currently installed on my machine. Which version I was building against.

What did I try

I thought that, I’d try something similar to how we check npm’s or yeoman’s versions. We do “npm –version” or “yo –version” for those. Nothing like that worked for SPFx. Meh.

What actually worked

It seems that, yes, npm was the way to go about this, but not the way I had tried. Try npm ls either global or not, depending on your setup.

npm ls -g --depth=0
npm ls --depth=0
A snapshot from the command prompt shower how to get the installed version of the SPFx generator

How to get the SPFx generator version from the command line

References

The above solution was found at Waldek Mastykarz’s blog, where he explains why you should care about the installed version and also shows how to get the SPFx version from an .sppkg file or from your project’s package.json file.

  1. How to check SharePoint Framework version
MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.