Не могу найти модуль "красивее" - PullRequest
0 голосов
/ 28 сентября 2019

Я обновил все пакеты, но все еще получаю эту ошибку после запуска npm run serve :

Ошибка сборки модуля (из ./node_modules/eslint-loader/index.js): Ошибка: Не удается найти модуль «красивее». Произошло во время linting / home

Мой package.json

{
  "name": "app",
  "version": "0.1.0",
  "private": false,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.2.1",
    "firebase": "^7.0.0",
    "material-icons": "^0.3.1",
    "register-service-worker": "^1.6.2",
    "vue": "^2.6.10",
    "vue-flickity": "^1.2.1",
    "vue-router": "^3.1.3",
    "vuetify": "^2.0.19",
    "vuex": "^3.1.1"
  },
  "devDependencies": {
    "@mdi/font": "^4.4.95",
    "@vue/cli-plugin-babel": "^3.11.0",
    "@vue/cli-plugin-eslint": "^3.11.0",
    "@vue/cli-plugin-pwa": "^3.11.0",
    "@vue/cli-service": "^3.11.0",
    "@vue/eslint-config-prettier": "^5.0.0",
    "babel-eslint": "^10.0.3",
    "eslint": "^6.4.0",
    "eslint-plugin-vue": "^5.2.3",
    "material-design-icons-iconfont": "^5.0.1",
    "stylus": "^0.54.7",
    "stylus-loader": "^3.0.2",
    "uglifyjs-webpack-plugin": "^2.2.0",
    "vue-cli-plugin-vuetify": "^0.6.3",
    "vue-template-compiler": "^2.6.10",
    "vuetify-loader": "^1.3.0",
    "webpack": "^4.41.0",
    "webpack-cli": "^3.3.9"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "@vue/prettier"
    ],
    "rules": {
      "no-console": "off"
    },
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions"
  ]
}

**"@vue/eslint-config-prettier": "^5.0.0",** is listed in the dependencies. How to fix this issue? (I'm using VSCODE on Ubuntu)

Я несколько раз пытался удалить package-lock.json и node_modules и запуск npm после установки.Ничто не исправляет это - даже обновление всех пакетов глобально.

1 Ответ

1 голос
/ 28 сентября 2019

Prettier - это одноранговая зависимость @ vue / eslint-config-prettier , поэтому вам необходимо добавить ее в свои собственные зависимости:

npm install —save-dev prettier
...