Sp-dev-fx-webparts: Mention supported node versions

Created on 18 Jun 2020  路  12Comments  路  Source: pnp/sp-dev-fx-webparts

Sample (which sample are you talking about)

No particular sample, this is about the main readme.md

Authors

@VesaJuvonen

Suggestion (the more details, the better)

I recently started using node.js again after a while, and installed the latest stable version, which is 12.x.
Most or maybe all samples in this repo do not support node version more than 11.0, and maybe have requirement for specific versions.
It is good if the required versions can be specified in the main readme, saving a lot of time and effort for new devs in setting up the required environment.

If this is sample specific, please close this issue by mentioning this, and I'll raise an issue for the specific sample which I was using (react-script-editor)

Needs

Most helpful comment

@AbhishekGarg I totally get your point.

I've written a little article on the site to (I hope) help reduce frustration. I'd love your feedback/comments/suggestions:
https://pnp.github.io/sp-dev-fx-webparts/gettingstarted/troubleshooting/

All 12 comments

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Each SPFx version is compatible with some Node version. The latest version 1.10.0 supports Node 10.x

So when a developer looks at a sample and knows what is the SPFx version of the sample, that gives the answer to use, which version of Node.

Also, you can refer to @hugoabernier 's Article - SPFx Compatibility matrix

In this case, I'll request to update the documentation to state this fact (SPFx - Node version), and of course, provide the compatibility matrix link.

@AbhishekGarg that's a great idea!

We welcome contributions in this repository, is this something you'd like to contribute? I can assign the issue to you.

Let me know!

@hugoabernier I am definitely willing to contribute to this.
Let's wait for feedback from @VesaJuvonen, we can take it forward.

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

@VesaJuvonen your comments please.

Node support is specifically called out in the spfx docs at https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment#install-nodejs.

@VesaJuvonen @hugoabernier I know this now, about the node-spfx support.
But when starting out, this was a point of struggle, where I had to install and uninstall multiple node versions to get to the correct ones.
I was just trying to package one or more webparts for use in my site collection, but was struggling due to the node versions.
If this point can be mentioned that SPFx versions and associated required node versions should be checked beforehand, that would be a great help.
This should obviously be done even before the npm install, and gulp serve (which finally shows the node version error) saving a lot of time.

I hope I am right in saying that documentation is a great help for newbies, rather than for experienced devs.
Trying to give suggestions to improve that from my own newbie experience.

@AbhishekGarg I totally get your point.

I've written a little article on the site to (I hope) help reduce frustration. I'd love your feedback/comments/suggestions:
https://pnp.github.io/sp-dev-fx-webparts/gettingstarted/troubleshooting/

@hugoabernier
The article is indeed helpful, Thank you very much for that :)
I will suggest to include the link in the readme for the repo, under "Troubleshooting", of course.

Edit:
Question - How to use the version label as filter for samples?

My other suggestion still remains, though.
Include the point about SPFx-node version compatibility, in the main readme (before npm-install), maybe even in the troubleshooting article.

It could go something like, "Be sure to check the required nodejs version compatible with the SPFx version for the sample you are intending to use (check SPFx version in sample). "

Every sample dev writes the sample readme in their own style, so "minimal path to awesome" does have different instructions.
It would be great if the above-mentioned point (SPFx-node) could be mentioned in the main readme.

Picture this:
A new dev comes to the repo, looking for some sample, or maybe through a link to a sample. They haven't used node, npm, git, SPFx. It is still easy to set this up by following the instructions in the main readme, combined with the sample readme.
But, the point about knowing the required nodejs version is not. It comes up only after gulp serve (which takes its own time after npm install) and then the whole cycle has to go again -- uninstall nodejs -> reinstall required version -> npm install -> gulp serve. (Unfortunately, package installers did not work well for me).
Now, multiply that by the number of times a person tries to use a different sample, which, god forbid, requires another nodejs version (mostly lower).

I apologize for pressing the point repeatedly. Just trying to help and improve.

Was this page helpful?
0 / 5 - 0 ratings