npm run build和npm run dev 报错 iview TypeError [ERR_INVALID_CALLBACK]: Callback must be a function

npm run build:


npm run build和npm run dev 报错 iview TypeError [ERR_INVALID_CALLBACK]: Callback must be a function_第1张图片
image.png

npm run dev:


npm run build和npm run dev 报错 iview TypeError [ERR_INVALID_CALLBACK]: Callback must be a function_第2张图片
image.png

两者报错信息除了报错的js文件不同外,其他信息基本一致,根据报错路径分别找到:
E:\idea_workspace\interest-master\interest-web\webpack.prod.config.js
E:\idea_workspace\interest-master\interest-web\webpack.dev.config.js
打开并将其中的:fs.write(fd, buf, 0, buf.length, 0, function(err, written, buffer) {});
替换为:fs.write(fd, buf, 0, 'utf-8', function(err, written, buffer) {});
保存然后重新执行npm run build:或者npm run dev

你可能感兴趣的:(npm run build和npm run dev 报错 iview TypeError [ERR_INVALID_CALLBACK]: Callback must be a function)