Jest error, Requires Babel “^7.0.0-0”, but was loaded with “6.26.3”
I am tyring to run my jest
tests but keep getting the error below, how can I get my jest tests to run?
● Test suite failed to run
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.
at throwVersionError (node_modules/@babel/helper-plugin-utils/lib/index.js:65:11)
I have followed the instruction here, but still no joy.
https://jestjs.io/docs/en/getting-started.html#using-babel
My package.json:
{
"name": "rgcalendar",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"test:watch": "npm test -- --watch"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"fsevents": "^1.2.4",
"googleapi": "^1.0.2",
"jest-cli": "^23.6.0",
"moment": "^2.22.2",
"native-base": "^2.8.1",
"node-google-calendar": "^1.1.1",
"prettier": "^1.13.7",
"prop-types": "^15.6.2",
"react": "16.3.1",
"react-dom": "^16.5.0",
"react-native": "^0.57.4",
"react-native-autoreheight-webview": "^1.1.1",
"react-native-calendars": "^1.20.0",
"react-native-events-calendar": "^1.0.8",
"react-native-fontawesome": "^5.7.0",
"react-native-google-signin": "^1.0.0-rc6",
"react-native-iphone-x-helper": "^1.0.3",
"react-native-responsive-fontsize": "^0.1.2",
"react-native-responsive-image": "^2.3.1",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.5.5",
"react-navigation-redux-helpers": "^2.0.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"watchman": "^1.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.49",
"@babel/core": "^7.1.6",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.49",
"@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.49",
"@babel/preset-env": "^7.0.0-beta.49",
"@babel/preset-flow": "^7.0.0-beta.49",
"@babel/preset-react": "^7.0.0-beta.49",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "8.2.3",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.0-beta",
"babel-plugin-module-resolver": "^3.1.1",
"enzyme-adapter-react-16": "^1.5.0",
"eslint": "^5.0.1",
"jest": "23.2.0",
"jest-enzyme": "^6.0.4",
"react-native-mock": "^0.3.1",
"react-test-renderer": "16.3.1",
"regenerator-runtime": "^0.12.1"
}
}
babelrc:
{
"presets": ["env", "react"],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import"
]
}
javascript reactjs jestjs
add a comment |
I am tyring to run my jest
tests but keep getting the error below, how can I get my jest tests to run?
● Test suite failed to run
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.
at throwVersionError (node_modules/@babel/helper-plugin-utils/lib/index.js:65:11)
I have followed the instruction here, but still no joy.
https://jestjs.io/docs/en/getting-started.html#using-babel
My package.json:
{
"name": "rgcalendar",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"test:watch": "npm test -- --watch"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"fsevents": "^1.2.4",
"googleapi": "^1.0.2",
"jest-cli": "^23.6.0",
"moment": "^2.22.2",
"native-base": "^2.8.1",
"node-google-calendar": "^1.1.1",
"prettier": "^1.13.7",
"prop-types": "^15.6.2",
"react": "16.3.1",
"react-dom": "^16.5.0",
"react-native": "^0.57.4",
"react-native-autoreheight-webview": "^1.1.1",
"react-native-calendars": "^1.20.0",
"react-native-events-calendar": "^1.0.8",
"react-native-fontawesome": "^5.7.0",
"react-native-google-signin": "^1.0.0-rc6",
"react-native-iphone-x-helper": "^1.0.3",
"react-native-responsive-fontsize": "^0.1.2",
"react-native-responsive-image": "^2.3.1",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.5.5",
"react-navigation-redux-helpers": "^2.0.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"watchman": "^1.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.49",
"@babel/core": "^7.1.6",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.49",
"@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.49",
"@babel/preset-env": "^7.0.0-beta.49",
"@babel/preset-flow": "^7.0.0-beta.49",
"@babel/preset-react": "^7.0.0-beta.49",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "8.2.3",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.0-beta",
"babel-plugin-module-resolver": "^3.1.1",
"enzyme-adapter-react-16": "^1.5.0",
"eslint": "^5.0.1",
"jest": "23.2.0",
"jest-enzyme": "^6.0.4",
"react-native-mock": "^0.3.1",
"react-test-renderer": "16.3.1",
"regenerator-runtime": "^0.12.1"
}
}
babelrc:
{
"presets": ["env", "react"],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import"
]
}
javascript reactjs jestjs
add a comment |
I am tyring to run my jest
tests but keep getting the error below, how can I get my jest tests to run?
● Test suite failed to run
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.
at throwVersionError (node_modules/@babel/helper-plugin-utils/lib/index.js:65:11)
I have followed the instruction here, but still no joy.
https://jestjs.io/docs/en/getting-started.html#using-babel
My package.json:
{
"name": "rgcalendar",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"test:watch": "npm test -- --watch"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"fsevents": "^1.2.4",
"googleapi": "^1.0.2",
"jest-cli": "^23.6.0",
"moment": "^2.22.2",
"native-base": "^2.8.1",
"node-google-calendar": "^1.1.1",
"prettier": "^1.13.7",
"prop-types": "^15.6.2",
"react": "16.3.1",
"react-dom": "^16.5.0",
"react-native": "^0.57.4",
"react-native-autoreheight-webview": "^1.1.1",
"react-native-calendars": "^1.20.0",
"react-native-events-calendar": "^1.0.8",
"react-native-fontawesome": "^5.7.0",
"react-native-google-signin": "^1.0.0-rc6",
"react-native-iphone-x-helper": "^1.0.3",
"react-native-responsive-fontsize": "^0.1.2",
"react-native-responsive-image": "^2.3.1",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.5.5",
"react-navigation-redux-helpers": "^2.0.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"watchman": "^1.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.49",
"@babel/core": "^7.1.6",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.49",
"@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.49",
"@babel/preset-env": "^7.0.0-beta.49",
"@babel/preset-flow": "^7.0.0-beta.49",
"@babel/preset-react": "^7.0.0-beta.49",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "8.2.3",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.0-beta",
"babel-plugin-module-resolver": "^3.1.1",
"enzyme-adapter-react-16": "^1.5.0",
"eslint": "^5.0.1",
"jest": "23.2.0",
"jest-enzyme": "^6.0.4",
"react-native-mock": "^0.3.1",
"react-test-renderer": "16.3.1",
"regenerator-runtime": "^0.12.1"
}
}
babelrc:
{
"presets": ["env", "react"],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import"
]
}
javascript reactjs jestjs
I am tyring to run my jest
tests but keep getting the error below, how can I get my jest tests to run?
● Test suite failed to run
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.
at throwVersionError (node_modules/@babel/helper-plugin-utils/lib/index.js:65:11)
I have followed the instruction here, but still no joy.
https://jestjs.io/docs/en/getting-started.html#using-babel
My package.json:
{
"name": "rgcalendar",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"test:watch": "npm test -- --watch"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"fsevents": "^1.2.4",
"googleapi": "^1.0.2",
"jest-cli": "^23.6.0",
"moment": "^2.22.2",
"native-base": "^2.8.1",
"node-google-calendar": "^1.1.1",
"prettier": "^1.13.7",
"prop-types": "^15.6.2",
"react": "16.3.1",
"react-dom": "^16.5.0",
"react-native": "^0.57.4",
"react-native-autoreheight-webview": "^1.1.1",
"react-native-calendars": "^1.20.0",
"react-native-events-calendar": "^1.0.8",
"react-native-fontawesome": "^5.7.0",
"react-native-google-signin": "^1.0.0-rc6",
"react-native-iphone-x-helper": "^1.0.3",
"react-native-responsive-fontsize": "^0.1.2",
"react-native-responsive-image": "^2.3.1",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.5.5",
"react-navigation-redux-helpers": "^2.0.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"watchman": "^1.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.49",
"@babel/core": "^7.1.6",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.49",
"@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.49",
"@babel/preset-env": "^7.0.0-beta.49",
"@babel/preset-flow": "^7.0.0-beta.49",
"@babel/preset-react": "^7.0.0-beta.49",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "8.2.3",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.0-beta",
"babel-plugin-module-resolver": "^3.1.1",
"enzyme-adapter-react-16": "^1.5.0",
"eslint": "^5.0.1",
"jest": "23.2.0",
"jest-enzyme": "^6.0.4",
"react-native-mock": "^0.3.1",
"react-test-renderer": "16.3.1",
"regenerator-runtime": "^0.12.1"
}
}
babelrc:
{
"presets": ["env", "react"],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import"
]
}
javascript reactjs jestjs
javascript reactjs jestjs
edited Nov 15 '18 at 16:40
skyboyer
3,98811230
3,98811230
asked Nov 15 '18 at 10:18
BomberBomber
2,118113568
2,118113568
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I had the same issue. Upgrading to jest@24.0.0
worked for me.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317161%2fjest-error-requires-babel-7-0-0-0-but-was-loaded-with-6-26-3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I had the same issue. Upgrading to jest@24.0.0
worked for me.
add a comment |
I had the same issue. Upgrading to jest@24.0.0
worked for me.
add a comment |
I had the same issue. Upgrading to jest@24.0.0
worked for me.
I had the same issue. Upgrading to jest@24.0.0
worked for me.
answered Jan 29 at 22:18
JoeJoe
141110
141110
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317161%2fjest-error-requires-babel-7-0-0-0-but-was-loaded-with-6-26-3%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown