SPFX 共享点 Web 部件的节点 JS 和 npm 安装

Node JS and npm installtion for SPFX sharepoint webpart

我正在尝试为 Sharepoint SPFX Web 部件安装节点 js 和 npm。(节点版本:v14.4.0,Npm 版本:6.14.5)。 当我尝试“gulp trust-dev-cert”时出现以下错误:

ReferenceError: primordials is not defined
    at fs.js:39:5
    at req_ (\node_modules\natives\index.js:143:24)
    at Object.req [as require] (D:\VM_NodeJS\GetSharePointListItems_001\node_modules\natives\index.js:55:10)
    at Object.<anonymous> (\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (\node_modules\vinyl-fs\node_modules\graceful-fs\graceful-fs.js:3:27)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
About to exit with code: 1
Process terminated before summary could be written, possible error in async code not continuing!
Trying to exit with exit code 1

当我 运行 时出现以下错误:gulp 服务命令

ReferenceError: primordials is not defined
    at fs.js:39:5
    at req_ (\node_modules\natives\index.js:143:24)
    at Object.req [as require] (\node_modules\natives\index.js:55:10)
    at Object.<anonymous> (\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (\node_modules\vinyl-fs\node_modules\graceful-fs\graceful-fs.js:3:27)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
About to exit with code: 1
Process terminated before summary could be written, possible error in async code not continuing!
Trying to exit with exit code 1

--

请帮我安装正确的版本。

SPFX 仅支持 Node.js 10.x。

您可以在此处获取此信息:

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment