1

I'm trying to work on a project of a SPFx web part. The project was built normally but when I try to test my web part on my tenant the following error occurs:

Error: Your dev environment is running NodeJS version v18.12.1 which does not meet the requirements for running this tool. This tool requires a version of NodeJS that matches >=12.13.0 <13.0.0 || >=14.15.0 <15.0.0 || >=16.13.0 <17.0.0

How can I solve this?

Thanks in advance.

6
  • which version of SPFx generator are you using? Commented Dec 21, 2022 at 10:58
  • I am using [email protected]. So how am I supposed to degrade node js. Do I have to uninstall the latest one?
    – Lidia
    Commented Dec 21, 2022 at 11:08
  • Yes, uninstall the node js and again instal node js v16.13+. check my answer below for compatible version & more information Commented Dec 21, 2022 at 12:14
  • After installing node js v16.13.0, I am facing another error: [18:45:58] Error - 'spfx-serve' sub task errored after 332 ms . No development certificate found. Generate a new certificate manually or set the canGenerateNewCertificate parameter to true when calling ensureCertificateAsync. Was I suppose to run something after installing the new one?
    – Lidia
    Commented Dec 21, 2022 at 15:51
  • Run this command: gulp trust-dev-cert. Follow this documentation: learn.microsoft.com/en-us/sharepoint/dev/spfx/… Commented Dec 21, 2022 at 16:01

1 Answer 1

1

You are using Node JS version v18.12.1 which is not supported for SPFx development.

You have to use the supported Node JS version based on the SPFx version you are using.

For example:

enter image description here

Check this compatibility matrix for complete list: SPFx development environment compatibility


Also, you can use nvm to manage multiple node versions on same development environment, check this for more information: NodeJS not compatible

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.