Несоответствие версий пакетов Vue - PullRequest
0 голосов
/ 29 апреля 2019

Я пытаюсь добавить модульное тестирование в существующий vue-проект с помощью jest, но при попытке запустить свой первый тест я получаю сообщение об ошибке

Несоответствие версий пакетов Vue:

- vue@2.5.16
- vue-template-compiler@2.6.6

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

Но, глядя на мои пакеты, моя текущая версия Vue равна 2.6.6, а не 2.5.16.Я понятия не имею, где он видит эту версию 2.5.16.У меня нет vue, установленного глобально, только @ vue / cli @ 3.4.0.Любая помощь будет оценена.Ниже вы можете найти мой package.json, который содержит мою конфигурацию jest.

{
  "version": "1.0.0",
  "name": "asp.net",
  "private": true,
  "dependencies": {
    "@babel/core": "^7.4.0",
    "@tinymce/tinymce-vue": "^1.1.0",
    "@types/bootstrap": "^3.3.40",
    "@types/jest": "^24.0.11",
    "@types/jquery": "^2.0.51",
    "@types/jquery.validation": "^1.16.5",
    "@types/jqueryui": "^1.12.6",
    "@types/kendo-ui": "^2018.3.0",
    "@types/knockout": "^3.4.60",
    "@types/moment": "^2.13.0",
    "axios": "^0.18.0",
    "axios-cache-adapter": "^2.1.1",
    "browser-detect": "^0.2.28",
    "es6-promise": "^4.2.5",
    "file-saver": "^1.3.8",
    "knockout": "^3.4.2",
    "moment-timezone": "^0.5.23",
    "query-string": "^6.2.0",
    "tinymce-vue": "^1.0.0",
    "url-search-params-polyfill": "^5.0.0",
    "vee-validate": "^2.1.3",
    "vue": "^2.6.6",
    "vue-class-component": "^6.3.2",
    "vue-multiselect": "^2.1.3",
    "vue-notification": "^1.3.13",
    "vue-property-decorator": "^7.2.0",
    "vue-router": "^3.0.2",
    "vuejs-datepicker": "^1.5.4",
    "vuex": "^3.0.1",
    "vuex-persistedstate": "^2.5.4"
  },
  "scripts": {
    "dev": "webpack --mode development --watch --hot",
    "test": "npm run test:unit",
    "test:unit": "jest",
    "build": "webpack --mode production",
    "output": "webpack --profile --json > stats.json"
  },
  "devDependencies": {
    "@types/file-saver": "^1.3.1",
    "@vue/test-utils": "^1.0.0-beta.29",
    "babel-core": "^6.26.3",
    "babel-jest": "^24.7.1",
    "babel-loader": "^8.0.4",
    "babel-polyfill": "^6.26.0",
    "babel-preset-env": "^1.7.0",
    "babel-preset-stage-3": "^6.24.1",
    "css-loader": "^1.0.1",
    "hard-source-webpack-plugin": "^0.13.1",
    "jest": "^23.4.2",
    "node-sass": "^4.10.0",
    "printd": "^1.0.1",
    "sass-loader": "^7.1.0",
    "ts-jest": "^23.10.5",
    "ts-loader": "^4.5.0",
    "typescript": "^3.2.1",
    "uglifyjs-webpack-plugin": "^2.0.1",
    "vue-jest": "^3.0.4",
    "vue-loader": "^15.4.2",
    "vue-template-compiler": "^2.6.6",
    "webpack": "^4.28.4",
    "webpack-bundle-analyzer": "^3.0.3",
    "webpack-cli": "^3.1.2",
    "webpack-hot-middleware": "^2.24.3"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "ts",
      "json",
      "vue"
    ],
    "moduleDirectories": [
      ".",
      "<rootDir>/Scripts",
      "<rootDir>/Scripts/VueModules",
      "<rootDir>/Scripts/VueModules/SharedComponents",
      "<rootDir>/Scripts/VueModules/Candidates/",
      "node_modules"
    ],
    "moduleNameMapper": {
      "^@candidates$": "<rootDir>/Scripts/VueModules/Candidates",
      "^@shared$": "<rootDir>/Scripts/VueModules/SharedComponents",
      "^@app$": "<rootDir>/Scripts/VueModules",
      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/Scripts/VueModules/__mocks__/fileMock.js",
      "\\.(css|less|scss|sass)$": "<rootDir>/Scripts/VueModules/__mocks__/styleMock.js"
    },
    "transform": {
      ".*\\.(vue)$": "vue-jest",
      "^.+\\.tsx?$": "ts-jest"
    },
    "transformIgnorePatterns": [
      "node_modules/(?!vue)"
    ],
    "testURL": "http://localhost/",
    "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$"
  }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...