当我尝试执行gulp build
或gulp 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 上。有人能帮我解决这个问题吗?
1条答案
按热度按时间cfh9epnr1#
我最近也遇到了同样的问题。实际上
gulp 3.9
不适用于最新版本的node
。要么升级gulp
到v4
,要么降级node
版本。node v10
对我很有效。