iview / iview-project

This project is build for Vue.js 2 + vue-router + webpack2 + iView 3
MIT License
839 stars 389 forks source link

npm run dev报错 #74

Closed kelegele closed 6 months ago

kelegele commented 5 years ago

$ npm run dev

>iview-project@3.0.0 dev U:\Workspace\VSCode\Vue\ChinaLife-vue >webpack-dev-server --content-base ./ --open --inline --hot --compress --history-api-fallback --config webpack.dev.config.js

fs.js:128 throw new ERR_INVALID_CALLBACK(); ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function at maybeCallback (fs.js:128:9) at Object.write (fs.js:535:14) at U:\Workspace\VSCode\Vue\ChinaLife-vue\webpack.dev.config.js:10:6 at FSReqWrap.args [as oncomplete] (fs.js:140:20) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! iview-project@3.0.0 dev: webpack-dev-server --content-base ./ --open --inline --hot --compress --history-api-fallback --config webpack.dev.config.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the iview-project@3.0.0 dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\xxx\AppData\Roaming\npm-cache_logs\2019-03-22T07_57_50_699Z-debug.log

报错来自 webpack.dev.config.js

fs.open('./src/config/env.js', 'w', function (err, fd) {
  const buf = 'export default "development";';
  fs.write(fd, buf, 0, buf.length, 0, function (err, written, buffer){});
});