npm run serve 启动前端vue工程报错:Error: No ESLint configuration found

Posted mask哥

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了npm run serve 启动前端vue工程报错:Error: No ESLint configuration found相关的知识,希望对你有一定的参考价值。

ERROR  Failed to compile with 1 errors                             下午12:10:41

Module build failed (from ./node_modules/eslint-loader/index.js):
Error: No ESLint configuration found in
/Users/tt/Downloads/fvking/src.
    at CascadingConfigArrayFactory._finalizeConfigArray (/Users/tim/Downloads/fvking/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:432:19)
    at CascadingConfigArrayFactory.getConfigArrayForFile (/Users/tim/Downloads/fvking/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:271:21)
    at CLIEngine.isPathIgnored (/Users/tim/Downloads/fvking/node_modules/eslint/lib/cli-engine/cli-engine.js:951:18)
    at CLIEngine.executeOnText (/Users/tim/Downloads/fvking/node_modules/eslint/lib/cli-engine/cli-engine.js:868:38)
    at lint (/Users/tim/Downloads/fvking/node_modules/eslint-loader/index.js:278:17)
    at transform (/Users/tim/Downloads/fvking/node_modules/eslint-loader/index.js:252:18)
    at /Users/tim/Downloads/fvking/node_modules/loader-fs-cache/index.js:127:18
    at ReadFileContext.callback (/Users/tim/Downloads/fvking/node_modules/loader-fs-cache/index.js:31:14)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (node:fs:284:13)

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

 

解决方法:
          进入项目根目录执行如下命令
          npm init -y
          npm install eslint --save-dev
          ./node_modules/.bin/eslint --init
           

 

再次启动工程:npm run serve ,成功访问。。。

以上是关于npm run serve 启动前端vue工程报错:Error: No ESLint configuration found的主要内容,如果未能解决你的问题,请参考以下文章

vue项目启动时,npm run serve 和 npm run dev 的区别

vue项目启动时,npm run serve 和 npm run dev 的区别

npm run dev/build/serve

yarn run serve报错Error: Cannot find module ‘@vue/cli-plugin-babel‘ 的解决办法

vue启动项目报错:npm ERR! missing script: serve解决方法

使用 vue/cli 运行 npm run serve 时出现问题