https://github.com/vuejs/vue-jest/blob/master/package.json#L56
This line doesn't work
"babel-core@^6.25.0 || ^7.0.0-0"
Because @babel/core has changed of name as: "@babel/core"
I think this should be considered quickly. Indeed the vue cli is moving fast and using jest with @babel/core setup instead of babel-core breaks the testing. So we need to keep babel-core as dependencies, especially for vue-jest.
Of cours it will mean breaking change for vue-jest as peer dependencies will move forward and dependencies toward babel plugins too.
Actually, I was wrong!
As ^7.0.0-0 is valid semver range
https://github.com/facebook/jest/issues/7061#issuecomment-425371766
I believe this issue can be closed
the fact is we should not rely on babel-core anymore but @babel/core without any bridge. But I guess since jest is not ready this must have to wait
But a lot of projects are still using babel-core and I believe they will still be using it for a while.
Yes, babel-core@^7.0.0-0 is a valid semantic range that will allow any alpha or beta version or the babel bridge of babel 7: https://semver.npmjs.com/, which includes @babel/core.
This issue can be closed.
No, It's not true.
I got this error with [email protected]:
Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.
This dependency: "@babel/plugin-transform-modules-commonjs": "^6.26.0" force to babel@6 alaways!
$>npm ls
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected] deduped
โ โ โ โโโ [email protected] deduped
โ โ โโโ [email protected] deduped
โ โ โโโฌ [email protected]
โ โ โ โโโ [email protected] deduped
โ โ โ โโโ [email protected] deduped
โ โ โ โโโ [email protected] deduped
โ โ โ โโโ [email protected] deduped
โ โ โ โโโ [email protected] deduped
โ โ โโโ [email protected] deduped
@babel/plugin-transform-modules-commonjs looks like a dependency after Babel 7.
I don't understand your problem: do you want to upgrade to Babel 7? (so do it)
If not, you do not need anything with babel @7.1.0.
sorry, typo, I've upgraded to babel7. The orignal code is: https://github.com/vuejs/vue-jest/blob/4ac913d8a010fcdfa1c7fc5b4fe0cb5fc84eec79/package.json#L61
You don't have to worry about dependencies. Npm or yarn will manage this. You only need to focus on peer dependencies.
Here they are all fine.
Well, vue-jest doesn't work for me unless I install babel-core@^7.0.0-0. That should not be necessary as I have @babel/core@^7.7.0 installed already.
$ yarn add --dev babel-jest @babel/core
...
warning " > [email protected]" has unmet peer dependency "babel-core@^6.25.0 || ^7.0.0-0".
I am running into the similar warning. Running babel-core 7.7.5.
npm WARN [email protected] requires a peer of babel-core@^6.25.0 || ^7.0.0-0 but none is installed. You must install peer dependencies yourself.
ditto โ๏ธ
warning " > [email protected]" has unmet peer dependency "babel-core@^6.25.0 || ^7.0.0-0".
currently I have "@babel/core": "^7.8.4", "jest": "^25.1.0", and "vue-jest": "^3.0.3"
same here
warning " > [email protected]" has unmet peer dependency "babel-core@^6.25.0 || ^7.0.0-0".
package json is including "@babel/core": "^7.8.4", "jest": "^24.9.0", "vue-jest": "^3.0.5"
Same here too...
npm WARN [email protected] requires a peer of babel-core@^6.25.0 || ^7.0.0-0 but none is installed.
And...
@babel/[email protected]
[email protected]
[email protected]
Additionally, when running my unit tests I also see many failed tests with output similar to the following:
FAIL src/components/__tests__/EmptyRouterView.test.js
โ Test suite failed to run
Cannot find module 'babel-core'
Require stack:
- /Users/ajb/src/rucka/node_modules/vue-jest/lib/compilers/babel-compiler.js
- /Users/ajb/src/rucka/node_modules/vue-jest/lib/process.js
- /Users/ajb/src/rucka/node_modules/vue-jest/vue-jest.js
- /Users/ajb/src/rucka/node_modules/@jest/transform/build/ScriptTransformer.js
- /Users/ajb/src/rucka/node_modules/@jest/transform/build/index.js
- /Users/ajb/src/rucka/node_modules/jest-runtime/build/index.js
- /Users/ajb/src/rucka/node_modules/jest-runner/build/testWorker.js
- /Users/ajb/src/rucka/node_modules/jest-runner/node_modules/jest-worker/build/workers/processCh
ild.js
Require stack:
node_modules/vue-jest/lib/compilers/babel-compiler.js
node_modules/vue-jest/lib/process.js
node_modules/vue-jest/vue-jest.js
node_modules/@jest/transform/build/ScriptTransformer.js
node_modules/@jest/transform/build/index.js
node_modules/jest-runtime/build/index.js
node_modules/jest-runner/build/testWorker.js
node_modules/jest-runner/node_modules/jest-worker/build/workers/processChild.js
at Object.<anonymous> (node_modules/vue-jest/lib/compilers/babel-compiler.js:1:15)
Most helpful comment
I am running into the similar warning. Running babel-core 7.7.5.
npm WARN [email protected] requires a peer of babel-core@^6.25.0 || ^7.0.0-0 but none is installed. You must install peer dependencies yourself.