首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Nuxt.js:模块错误(来自./node_modules/eslint-loader/index.js):

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

Stack Overflow用户
提问于 2018-09-30 03:14:40
回答 2查看 13.3K关注 0票数 4

我以recommended的方式安装了Nuxt starter模板:

代码语言:javascript
复制
npx create-nuxt-app fffff

fffff内部,我安装了css-loder (npm install --save-dev css-loader),然后启动了服务器:npm run dev

我收到了这个错误消息:

代码语言:javascript
复制
> 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

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

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-09-30 08:25:01

create-nuxt-app生成的默认源代码不遵守ESlint +更漂亮的规则。

尝试手动修复每个规则:

例如:91:1 error Replace '······' with '····' =>将文件layouts/default.vue的第91行开头的6个空格替换为4个空格。

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

代码语言:javascript
复制
npx prettier --write "**/*.{vue,js}"
票数 15
EN

Stack Overflow用户

发布于 2019-07-12 17:21:03

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

代码语言:javascript
复制
  // nuxt.config.js
  modules: [
    '@nuxtjs/axios'
    // '@nuxtjs/eslint-module' :: bypass this module
  ],

我希望这能有所帮助。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52571675

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档