Gulp 获取错误参考Error:未定义primordial

dced5bon  于 2022-12-08  发布在  Gulp
关注(0)|答案(1)|浏览(169)

当我尝试执行gulp buildgulp watch时,出现以下错误-

ReferenceError: primordials is not defined
    at fs.js:47:5
    at req_ (/Users/testuser/projects/insights/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/Users/testuser/projects/insights/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/Users/testuser/projects/insights/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)

这些是下面的模块和我安装的版本。

node -v
v16.2.0

npm -v
7.13.0

gulp -v
CLI version: 2.3.0
Local version: 3.9.1

我在MacOS Catalina 上。有人能帮我解决这个问题吗?

cfh9epnr

cfh9epnr1#

我最近也遇到了同样的问题。实际上gulp 3.9不适用于最新版本的node。要么升级gulpv4,要么降级node版本。node v10对我很有效。

相关问题