0

需要将 Babel 7 和 Jest 与 Vue/Quasar CLI 一起使用。

我在 quasar discord 聊天中被告知 Jest 需要 Babel 7 beta 54。Jest 文档缺乏并且对 babel 7 的支持感到困惑,所以我接受了 discord 中的建议并让它完美运行,但在此期间我收到了很多警告现在“npm 安装”。

当我在谷歌上搜索这些警告时,我只能找到创建 github 问题的人在 Jest 和 Babel 以及 Quasar 和 Vue CLI 存储库中寻求帮助,并且人们告诉他们“它们只是警告,而不是错误”并且问题正在关闭: 没有人解决或解释问题。

有人可以解释如何让 Babel 7 和 Jest 在没有警告的情况下与 Quasar/Vue CLI 一起工作,或者解释为什么显示警告消息?

注意:警告消息文本实际上是不正确的。我有要求安装的版本。

注意:我尝试在 devDependencies 和 dependencies 中安装 7.0.0-beta.50 以及介于两者之间的每个版本,但都无济于事。

如果有帮助,我正在使用 Windows 10,尽管其他开发人员表示他们在 Mac 和 Linux 上收到了相同的警告。

npm install使用以下 package.json键入“”时出现的警告消息:

npm WARN @babel/plugin-proposal-class-properties@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-class-properties@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-import-meta@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/preset-stage-3@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-async-generator-functions@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-json-strings@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-object-rest-spread@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-optional-catch-binding@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-unicode-property-regex@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-async-generators@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-dynamic-import@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-json-strings@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-object-rest-spread@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-optional-catch-binding@7.0.0-beta.54 requires a peer of @babel/core@>=7.0.0-beta.50 <7.0.0-rc.0 but none is installed. You must install peer dependencies yourself.

包.json:

{
  "name": "test",
  "version": "1.0.0",
  "dependencies": {
    "@babel/core": "^7.1.2",
    "@babel/runtime": "^7.1.2",
    "debug": "^4.1.0",
    "es6-iterator": "^2.0.3",
    "gsap": "^2.0.2",
    "lodash.get": "^4.4.2",
    "socket.io-client": "^2.1.1",
    "vue-i18n": "^7.3.3",
    "vue-json-pretty": "^1.4.1",
    "perfect-scrollbar-vue2": "^1.2.0",
    "vuelidate": "^0.7.4",
    "vuex": "^3.0.1"
  },
  "devDependencies": {
    "@babel/plugin-proposal-decorators": "7.1.2",
    "@babel/plugin-proposal-export-namespace-from": "7.0.0",
    "@babel/plugin-proposal-function-sent": "7.1.0",
    "@babel/plugin-proposal-numeric-separator": "7.0.0",
    "@babel/plugin-proposal-object-rest-spread": "7.0.0",
    "@babel/plugin-proposal-throw-expressions": "7.0.0",
    "@babel/plugin-syntax-dynamic-import": "7.0.0",
    "@babel/plugin-transform-runtime": "7.1.0",
    "@babel/preset-env": "7.1.0",
    "@babel/preset-stage-2": "7.0.0",
    "@babel/types": "7.1.3",
    "@storybook/addon-actions": "^4.0.9",
    "@storybook/addon-links": "^4.0.9",
    "@storybook/addons": "^4.0.9",
    "@storybook/vue": "^4.0.9",
    "@vue/cli-plugin-unit-jest": "^3.0.5",
    "@vue/test-utils": "^1.0.0-beta.26",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^8.2.1",
    "babel-jest": "^23.6.0",
    "babel-loader": "^8.0.4",
    "babel-preset-vue": "^2.0.2",
    "eslint": "^4.18.2",
    "eslint-config-standard": "^11.0.0",
    "eslint-friendly-formatter": "^4.0.1",
    "eslint-loader": "^2.0.0",
    "eslint-plugin-import": "^2.9.0",
    "eslint-plugin-node": "^6.0.1",
    "eslint-plugin-promise": "^3.7.0",
    "eslint-plugin-standard": "^3.0.1",
    "eslint-plugin-vue": "^4.3.0",
    "eslint-plugin-vue-a11y": "0.0.28",
    "fse": "^4.0.1",
    "jest": "^23.6.0",
    "lighthouse": "^3.0.3",
    "mocha": "^5.2.0",
    "node-fetch": "^2.2.0",
    "pug": "^2.0.3",
    "pug-plain-loader": "^1.0.0",
    "quasar-cli": "^0.17.22",
    "request-promise": "^4.2.2",
    "socket.io-mock": "^1.2.3",
    "strip-ansi": "=3.0.1",
    "vue-jest": "^3.0.1",
    "wallaby-vue-compiler": "^1.0.3"
  },
  "engines": {
    "node": ">= 8.9.0",
    "npm": ">= 5.6.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 10"
  ]
}
4

0 回答 0