Javascript Nuxt.js:模块错误(来自./node_modules/eslint loader/index.js):

Javascript Nuxt.js:模块错误(来自./node_modules/eslint loader/index.js):,javascript,css-loader,nuxt.js,Javascript,Css Loader,Nuxt.js,我通过以下方式安装了Nuxt starter模板: 进入fffff后,我安装了cssloder(npm安装-保存开发css加载程序),然后启动服务器:npm运行开发 我收到了以下错误消息: > fffff@1.0.0 dev /home/begueradj/fffff > nuxt INFO Building project ✔ success Builder initialized ✔ success Nuxt files generated ERROR Fai

我通过以下方式安装了Nuxt starter模板:

进入
fffff
后,我安装了cssloder(
npm安装-保存开发css加载程序
),然后启动服务器:
npm运行开发

我收到了以下错误消息:

> fffff@1.0.0 dev /home/begueradj/fffff
> nuxt



 INFO  Building project

✔ success Builder initialized
✔ success Nuxt files generated


 ERROR  Failed to compile with 1 errors                                                                                                                         22:09:09

 error  in ./layouts/default.vue

Module Error (from ./node_modules/eslint-loader/index.js):

/home/begueradj/fffff/layouts/default.vue
   89:1  error  Delete `··`                           prettier/prettier
   90:3  error  Delete `··`                           prettier/prettier
   91:1  error  Replace `······` with `····`          prettier/prettier
   92:1  error  Delete `··`                           prettier/prettier
   93:1  error  Replace `········` with `······`      prettier/prettier
   94:1  error  Delete `··`                           prettier/prettier
   95:1  error  Replace `········` with `······`      prettier/prettier
   96:1  error  Delete `··`                           prettier/prettier
   97:1  error  Replace `··········` with `········`  prettier/prettier
   98:7  error  Delete `··`                           prettier/prettier
   99:1  error  Delete `··`                           prettier/prettier
  100:7  error  Delete `··`                           prettier/prettier
  101:1  error  Delete `··`                           prettier/prettier
  102:7  error  Delete `··`                           prettier/prettier
  103:5  error  Delete `··`                           prettier/prettier
  104:1  error  Replace `····` with `··`              prettier/prettier
  105:1  error  Delete `··`                           prettier/prettier

✖ 17 problems (17 errors, 0 warnings)
  17 errors and 0 warnings potentially fixable with the `--fix` option.


 @ ./.nuxt/App.js 4:0-47 6:14-23
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?name=client&reload=true&timeout=30000&path=/__webpack_hmr ./.nuxt/client.js



 READY  Listening on http://localhost:3000

这是什么原因?如何修复它?

创建nuxt应用程序生成的默认源代码不遵守ESlint+Prettier规则

尝试手动修复每个规则:

例如,
91:1错误将“·····”替换为“···”
=>将文件
layouts/default.vue
第91行开头的6个空格替换为4个空格

使用以下命令自动修复所有规则:

npx prettier --write "**/*.{vue,js}"

不推荐,但如果你只是想玩的话很有用

//nuxt.config.js
模块:[
“@nuxtjs/axios”
//“@nuxtjs/eslint模块”::绕过此模块
],

我希望这有帮助

太好了,你知道如何设置它吗?它一直运行,例如在保存时?是的!您可以按照此文档运行watcher:或者,您可以将编辑器配置为在保存时运行Pretter:我有史以来第一次创建了一个新的nuxt应用程序,但由于此ESLint错误而无法运行它。这为我解决了这个问题,只是模块在buildModules下。
npx prettier --write "**/*.{vue,js}"