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 init 出错 #58

Open pidehen23 opened 6 years ago

pidehen23 commented 6 years ago

C:\Users\10517\Desktop\iview-project-3.0>npm run init

iview-project@3.0.0 init C:\Users\10517\Desktop\iview-project-3.0 webpack --progress --config webpack.dev.config.js

0% compilingfs.js:133 throw new ERR_INVALID_CALLBACK(); ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function at maybeCallback (fs.js:133:9) at Object.write (fs.js:540:14) at C:\Users\10517\Desktop\iview-project-3.0\webpack.dev.config.js:10:8 at FSReqWrap.oncomplete (fs.js:145:20) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! iview-project@3.0.0 init: webpack --progress --config webpack.dev.config.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the iview-project@3.0.0 init 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\10517\AppData\Roaming\npm-cache_logs\2018-08-19T13_33_40_191Z-debug.log

tweikiang commented 6 years ago

In your "webpack.dev.config.js" replace fs.write(fd, buf, 0, buf.length, 0, function (err, written, buffer){}); with fs.write(fd, buf, function(err, written, buffer) {});

same goes to production webpack config

tanxuxu commented 6 years ago

npm run init