安装Vuetify之后需要其他装载程序

时间:2019-09-20 18:36:16

标签: vue.js

使用最新的VueCli构建的清洁项目,使用vue add vuetify添加了Vuetify。一切正常,添加了身份验证脚本,我今年已成功使用3次,现在我收到此错误

 ERROR  Failed to compile with 1 errors                                                                                                            7:26:18 PM

 error  in ./src/auth/authService.js

Module parse failed: Unexpected token (18:10)
File was processed with these loaders:
 * ./node_modules/eslint-loader/index.js
You may need an additional loader to handle the result of these loaders.
| 
| class AuthService extends EventEmitter {
>   idToken = null;
|   profile = null;
|   tokenExpiry = null;

 @ ./src/router.js 6:0-38 42:52-56 46:2-6
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.0.15:3000/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

被困住了,整日没有喜悦。我需要其他处理或配置吗?是这样我可以看到什么。

有帮助吗?

非常感谢

滚动包npm包,删除Node_modules(绝望),阅读我能找到的一切

/auth/authService.js


const localStorageKey = "loggedIn";
const loginEvent = "loginEvent";

class AuthService extends EventEmitter {
  idToken = null;
  profile = null;
  tokenExpiry = null;

  login(customState) {
    webAuth.authorize({
      appState: customState,
    });
  }

vue.config.js

const webpack = require("webpack");

module.exports = {
  devServer: {
    port: 3000
  },
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
        $: "jquery",
        jquery: "jquery",
        "window.jQuery": "jquery",
        jQuery: "jquery"
      })
    ]
  }
};

.eslint.js

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
  rules: {
    "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
    "comma-dangle": [
      "error",
      {
        arrays: "only-multiline",
        objects: "only-multiline",
        imports: "only-multiline",
        exports: "only-multiline",
        functions: "ignore"
      }
    ]
  },
  parserOptions: {
    parser: "babel-eslint"
  },
  overrides: [
    {
      files: ["**/__tests__/*.{j,t}s?(x)"],
      env: {
        mocha: true
      }
    }
  ]
};

package.json

{
  "name": "admin-sept-2019",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "test:unit": "vue-cli-service test:unit"
  },
  "dependencies": {
    "auth0-js": "^9.11.3",
    "core-js": "^2.6.5",
    "vue": "^2.6.10",
    "vue-router": "^3.0.3",
    "vuetify": "^2.0.0",
    "vuex": "^3.0.1"
  },
  "devDependencies": {
    "@babel/plugin-transform-classes": "^7.5.5",
    "@vue/cli-plugin-babel": "^3.11.0",
    "@vue/cli-plugin-eslint": "^3.11.0",
    "@vue/cli-plugin-unit-mocha": "^3.11.0",
    "@vue/cli-service": "^3.11.0",
    "@vue/eslint-config-prettier": "^5.0.0",
    "@vue/test-utils": "1.0.0-beta.29",
    "babel-eslint": "^10.0.1",
    "chai": "^4.1.2",
    "eslint": "^5.16.0",
    "eslint-plugin-prettier": "^3.1.0",
    "eslint-plugin-vue": "^5.0.0",
    "node-sass": "^4.9.0",
    "prettier": "^1.18.2",
    "sass": "^1.17.4",
    "sass-loader": "^7.1.0",
    "vue-cli-plugin-vuetify": "^0.6.3",
    "vue-template-compiler": "^2.6.10",
    "vuetify-loader": "^1.2.2"
  }
}

npm run serve将构建我的vue应用

0 个答案:

没有答案