Я получаю эту ошибку для каждого запускаемого набора тестов Jest:
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.
Но что странно, эта ошибка появляется только в том случае, если я пытаюсь установить пакеты через npm install
. Так в чем проблема? Что я делаю не так?
Постскриптум Я не хочу использовать yarn install
.
Вот мои paskage.json
s детали, связанные с бабелом, шуткой и энзимами:
{
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/plugin-proposal-class-properties": "^7.2.3",
"@babel/plugin-proposal-decorators": "^7.2.3",
"@babel/plugin-proposal-export-default-from": "^7.2.0",
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
"@babel/plugin-proposal-object-rest-spread": "^7.2.0",
"@babel/plugin-transform-object-assign": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-flow": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"babel-loader": "8.0.4",
"babel-plugin-react-docgen": "^2.0.0",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.7.1",
"jest": "^23.6.0",
"jest-enzyme": "^7.0.1",
"jest-pnp-resolver": "1.0.1",
"jest-resolve": "23.6.0",
},
}