1.npm run dev 失败
解决:
修改为:
fs.open('./build/env.js', 'w', function (err, fd) { const buf = 'export default "development";'; fs.write(fd, buf, 0, 'utf-8', function(err, written, buffer) {}); // fs.write(fd, buf, 0, buf.length, 0, function (err, written, buffer) { // }); });
2.npm run build失败
解决方案:
修改为:
fs.open('./build/env.js', 'w', function (err, fd) { const buf = 'export default "development";'; fs.write(fd, buf, 0, 'utf-8', function(err, written, buffer) {}); // fs.write(fd, buf, 0, buf.length, 0, function (err, written, buffer) { // }); });