Forum Discussion

john john's avatar
john john
Steel Contributor
Nov 13, 2021

Unable to run "gulp serve" for our SPFx web parts

I have developed an SPFx web part, and now i am trying to run gulp serve.. but i am getting these errors. Now i have 2 versions of node.js:-

C:\WINDOWS\system32>nvm list

  * 16.13.0 (Currently using 64-bit executable)
    8.16.2

Here are the errors:-

Your environment has been set up for using Node.js 16.13.0 (x64) and npm.

C:\Windows\System32>nvm use 8.16.2
Now using node v8.16.2 (64-bit)

C:\Windows\System32>cd C:\spfx-MyModalPopup

C:\spfx-MyModalPopup>gulp serve
Error: Your dev environment is running NodeJS version v8.16.2 which does not meet the requirements for running this tool. This tool requires a version of NodeJS that matches >=10.13.0 <11.0.0 || >=12.13.0 <13.0.0 || >=14.15.0 <15.0.0
    at SPWebBuildRig.initialize (C:\spfx-MyModalPopup\node_modules\@microsoft\sp-build-web\lib\SPBuildRig.js:27:19)
    at Object.exports.initialize (C:\spfx-MyModalPopup\node_modules\@microsoft\sp-build-web\lib\index.js:32:17)
    at Object.<anonymous> (C:\spfx-MyModalPopup\gulpfile.js:16:7)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)

C:\spfx-MyModalPopup>nvm list

    16.13.0
  * 8.16.2 (Currently using 64-bit executable)

C:\spfx-MyModalPopup>nvm use 16.13.0
Now using node v16.13.0 (64-bit)

C:\spfx-MyModalPopup>gulp serve
ReferenceError: primordials is not defined
    at fs.js:47:5
    at req_ (C:\spfx-MyModalPopup\node_modules\natives\index.js:143:24)
    at Object.req [as require] (C:\spfx-MyModalPopup\node_modules\natives\index.js:55:10)
    at Object.<anonymous> (C:\spfx-MyModalPopup\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)

any advice why i am unable to run gulp serve to run my SPFx web part? Thanks

here are the node.js & gulp versions i have:-

C:\spfx-MyModalPopup>gulp --version
CLI version: 2.3.0
Local version: 3.9.1


C:\spfx-MyModalPopup>node --version
v16.13.0

and i tried gulp serve on another SPFx web part >> and i got this error:-

C:\react-enhanced-list-formatting>nvm use 16.13.0
Now using node v16.13.0 (64-bit)

C:\react-enhanced-list-formatting>gulp serve
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
    at module.exports (C:\node_modules\node-sass\lib\binding.js:13:13)
    at Object.<anonymous> (C:\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\react-enhanced-list-formatting\node_modules\@microsoft\gulp-core-build-sass\lib\SassTask.js:11:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)

5 Replies

    • john john's avatar
      john john
      Steel Contributor

      Joao Liviook thanks for the reply and the links, but why i need to use node 1.10.24 ? can you explain this as seems it is too old version  ? thanks

      • Joao Livio's avatar
        Joao Livio
        Iron Contributor

        john john 

        What generator are you using? 11.1, 12, 13?

         

        I misspell the node version, is 1.24.1. I use this version because for my experience is the one that won't give me any problems until now. Versions that are allowed are 10, 12 and 14 depending on you generator version. Here I can see you are target to version 16, see what you shared

         

         

        nvm use 16.13.0
        Now using node v16.13.0 (64-bit)

         

         

        I send you that links because you have another options to don't get dependent of @microsoft/sharepoint generator, and have more options like choose the TypeScript version and use DevOps Pipelines templates.

         

        Your error is in the node version 16.

Resources