Vue日常报错

Posted biaogejiushibiao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Vue日常报错相关的知识,希望对你有一定的参考价值。

报错信息:

Error: Cannot find module ‘webpack/bin/config-yargs‘
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (E:MIKEYWebStromWorkSpaceTestWebpackVue
ode_moduleswebpack-dev-serverinwebpack-dev-server.js:54:1)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `webpack-dev-server --open --port 3000 --contentBase src --hot`
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:MIKEYNodeJs
ode_cache\\_logs2018-11-21T14_46_04_994Z-debug.log

E:MIKEYWebStromWorkSpaceTestWebpackVue>npm i [email protected] -D

> [email protected] postinstall E:MIKEYWebStromWorkSpaceTestWebpackVue
ode_modulesuglifyjs-webpack-plugin
> node lib/post_install.js

npm WARN [email protected] requires a peer of [email protected]^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected]^2.3.1 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected]^4.x.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

 

报错截图:

技术分享图片

 

解决方法:webpack和webpack-dev-server版本兼容问题,更改版本即可!

以上是关于Vue日常报错的主要内容,如果未能解决你的问题,请参考以下文章

Vue日常报错

vue-个人学习----组件

报错:✘ http://eslint.org/docs/rules/indent Expected indentation of 0 s paces but found 2(代码片段

报错:✘ http://eslint.org/docs/rules/indent Expected indentation of 0 s paces but found 2(代码片段

译文:18个实用的JavaScript代码片段,助你快速处理日常编程任务

VSCode自定义代码片段1——vue主模板