解决: Cannot find module 'eslint/lib/util/traverser'

报错信息

 error  in ./src/main.js

Module build failed (from ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js):
Error: Failed to load plugin 'vue' declared in '.eslintrc.js': Cannot find module 'eslint/lib/util/traverser'
Require stack:
- F:\lianghao\lianghao_ui\node_modules\eslint-plugin-vue\lib\rules\order-in-components.js
- F:\lianghao\lianghao_ui\node_modules\eslint-plugin-vue\lib\index.js
- F:\lianghao\lianghao_ui\node_modules\eslint\lib\cli-engine\config-array-factory.js
- F:\lianghao\lianghao_ui\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js
- F:\lianghao\lianghao_ui\node_modules\eslint\lib\cli-engine\cli-engine.js
- F:\lianghao\lianghao_ui\node_modules\eslint\lib\cli-engine\index.js
- F:\lianghao\lianghao_ui\node_modules\eslint\lib\api.js
- F:\lianghao\lianghao_ui\node_modules\@vue\cli-plugin-eslint\node_modules\eslint-loader\index.js
- F:\lianghao\lianghao_ui\node_modules\loader-runner\lib\loadLoader.js
- F:\lianghao\lianghao_ui\node_modules\loader-runner\lib\LoaderRunner.js
- F:\lianghao\lianghao_ui\node_modules\webpack\lib\NormalModule.js
- F:\lianghao\lianghao_ui\node_modules\webpack\lib\NormalModuleFactory.js
- F:\lianghao\lianghao_ui\node_modules\webpack\lib\Compiler.js
- F:\lianghao\lianghao_ui\node_modules\webpack\lib\webpack.js
- F:\lianghao\lianghao_ui\node_modules\@vue\cli-service\lib\commands\serve.js
- F:\lianghao\lianghao_ui\node_modules\@vue\cli-service\lib\Service.js
- F:\lianghao\lianghao_ui\node_modules\@vue\cli-service\bin\vue-cli-service.js
Referenced from: F:\lianghao\lianghao_ui\.eslintrc.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (F:\lianghao\lianghao_ui\node_modules\eslint-plugin-vue\lib\rules\order-in-components.js:8:19)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (F:\lianghao\lianghao_ui\node_modules\eslint-plugin-vue\lib\index.js:37:28)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)

 @ multi (webpack)-dev-server/client?http://192.168.1.89:8082/sockjs-node (webpack)/hot/dev-server.js ./src/main.js babel-polyfill classlist-polyfill

解决方案:

执行 npm install eslint-plugin-vue -u

你可能感兴趣的:(前端,vue.js)