• Module Error (from ./node_modules/eslint-loader/index.js):解决办法


    vue启动项目报如下错误:

    Failed to compile.
    
    ./src/components/Vcontent.vue
    Module Error (from ./node_modules/eslint-loader/index.js):
    
    E:myvuesrccomponentsVcontent.vue
      4:15  error  Parsing error: unexpected-character-in-attribute-name  vue/no-parsing-error
      4:37  error  Parsing error: unexpected-character-in-attribute-name  vue/no-parsing-error
    
    ? 2 problems (2 errors, 0 warnings)

    当vue渲染html为原生标签时出这个错误,需要修改配置项。

    优化如下:

    第一步:初始化并重新安装eslint

    npm init -y
    npm install eslint --save-dev

    第二步:进入node_modules下的bin目录,并初始化eslint

    cd ./node_modules/.bin/
    eslint --init

    第三步:设置配置选项,除选择vue.js外,其他都选择默认项或者y或者Y,如下仅仅到选择vue.js步骤

    ? How would you like to use ESLint? To check syntax and find problems
    ? What type of modules does your project use? JavaScript modules (import/export)
    ? Which framework does your project use? Vue.js

    第四步:最重要的一步,将node_modules目录下的bin目录里面的.eslintrc.js文件拷贝到项目根目录下

    第五步:启动服务,严重结果:

    npm run serve

    结束!

  • 相关阅读:
    [CEOI2008] order
    Atcoder 2373 Cookie Exchanges
    [POI2011]ROT-Tree Rotations
    bzoj 5216: [Lydsy2017省队十连测]公路建设
    bzoj 5215: [Lydsy2017省队十连测]商店购物
    Codeforces 961 E Tufurama
    [九省联考2018] 秘密袭击coat
    Codeforces 961 D Pair Of Lines
    [八省联考2018] 劈配
    [九省联考2018]一双木棋chess
  • 原文地址:https://www.cnblogs.com/aaronthon/p/12917679.html
Copyright © 2020-2023  润新知