我正在使用laravel elixir和gulp来编译我的sass文件。但是当我在Terminal中编写gulp时,会出现此错误。
fs.js:27
const { Math, Object } = primordials;
^
ReferenceError: primordials is not defined
at fs.js:27:26
at req_ (/home/user/Videos/projetct-folder/project/node_modules/natives/index.js:143:24)
at Object.req [as require] (/home/user/Videos/projetct-folder/projetct/node_modules/natives/index.js:55:10)
at Object.<anonymous> (/home/user/Videos/projetct-folder/projetct/node_modules/laravel-elixir-livereload/node_modules/graceful-fs/fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (internal/modules/cjs/helpers.js:16:16)
节点版本:12.4.0
gulp CLI版本:2.2.0
gulp本地版本:4.0.2
gulpfile.js:
var elixir = require('laravel-elixir');
require('laravel-elixir-livereload');
elixir.config.assetsPath = 'themes/project/assets/';
elixir.config.publicPath = 'themes/project/assets/compiled/';
elixir(function(mix){
mix.sass('agency.scss');
mix.scripts([
'jqBootstrapValidation.js',
'agency.js',
'contact_me.js',
'recherche.js'
]);
mix.livereload([
'themes/project/assets/compiled/css/agency.css',
'themes/project/**/*.htm',
'themes/project/assets/compiled/js/*.js'
])
})
答案 0 :(得分:0)
根据此bug report for Gulp判断,其中一个依赖项可能正在使用Gulp 3
项目中的一个软件包可能需要使用gulp3。如果您检查包含已安装软件包列表的package-lock.json,则应该可以对它进行整理。
它特别提到了graceful-fs模块。