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