需要将Babel 7和Jest与Vue / Quasar CLI一起使用。
在类星体不和谐聊天中,有人告诉我Jest需要Babel 7 beta54。Jest文档缺少和混淆周围的Babel 7支持,因此我采纳了Disord中的建议并使其完美运行,但是我得到了很多现在在“ npm安装”过程中出现警告。
当我在Google上搜索这些警告时,我能找到的是创建github问题的人在Jest,Babel,Quasar和Vue CLI仓库中寻求帮助,然后人们告诉他们“它们只是警告,而不是错误”,并且已解决的问题:没有人解决或解释问题。
有人可以解释一下如何使Babel 7和Jest在没有警告的情况下与Quasar / Vue CLI一起使用吗,或者解释为什么显示警告消息?
注意:警告消息文本实际上不正确。我有要求安装的版本。
注意:我尝试安装7.0.0-beta.50及其之间的每个版本,无论是在devDependencies还是在依赖项中,都没有得到警告。
如果有帮助,我正在使用Windows 10,尽管其他开发人员说他们在Mac和Linux上也收到相同的警告。
在以下package.json中键入“ npm install
”时出现的警告消息:
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.
package.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"
]
}