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

时间:2021-04-02 14:42:34

运行npm run dev报这个错
npm run dev 报错 iview TypeError [ERR_INVALID_CALLBACK]: Callback must be a function

然后找到 D:\text\vue\iview-admin\build\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 dev