错误1:
PS E:\IdeaProjects\template\vueAsset> npm run dev
> [email protected] dev E:\IdeaProjects\template\vueAsset
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
10% building modules 1/1 modules 0 activeevents.js:174
throw er; // Unhandled 'error' event
^
Error: listen EADDRNOTAVAIL: address not available 192.168.100.109:9527
at Server.setupListenHandle [as _listen2] (net.js:1262:19)
at listenInCluster (net.js:1327:12)
at doListen (net.js:1460:7)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1306:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! E:\nodejs\node_cache\_logs\2019-07-24T08_37_38_098Z-debug.log
解决:
因为机器重启,DHCP重新分配了IP。重新配置工程绑定当前分配的IP就可以了,或者修改本机的IP为静态IP,问题就解决了。
1:打开cmd,命令行运行 ipconfig,得到本机的ip地址:
2:找到config文件夹下的index.js文件,打开后,将host的值改为我上一步所得到的ipv4即可
错误2:
Module build failed (from ./node_modules/vue-loader/lib/index.js):
Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.
at loadTemplateCompiler (E:\IdeaProjects\template\vueAsset\node_modules\vue-loader\lib\index.js:21:11)
at Object.module.exports (E:\IdeaProjects\template\vueAsset\node_modules\vue-loader\lib\index.js:65:35)
解决——输入即可:
npm install vue-template-compiler -D