【问题标题】:Node JS and npm installtion for SPFX sharepoint webpart用于 SPFX 共享点 Web 部件的节点 JS 和 npm 安装
【发布时间】:2021-01-02 00:34:05
【问题描述】:

我正在尝试为 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 serve 命令

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

--

请帮我安装正确的版本。

【问题讨论】:

    标签: node.js npm sharepoint npm-install spfx


    【解决方案1】:

    SPFX 仅支持 Node.js 10.x。

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

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

    【讨论】:

      猜你喜欢
      • 2019-06-27
      • 1970-01-01
      • 1970-01-01
      • 2010-12-18
      • 1970-01-01
      • 1970-01-01
      • 2014-06-12
      • 2015-08-08
      • 2011-01-17
      相关资源
      最近更新 更多