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
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.