У меня есть проект, настроенный с помощью Webpack 4 и Babel 6, и я хочу выполнить обновление до Babel 7. Я установил следующие пакеты:
+ "@babel/cli": "^7.2.3",
+ "@babel/core": "^7.2.2",
+ "@babel/plugin-syntax-dynamic-import": "^7.2.0",
+ "@babel/preset-env": "^7.2.3",
+ "@babel/preset-flow": "^7.0.0",
+ "@babel/preset-react": "^7.0.0",
+ "babel-loader": "^8.0.5",
+ "css-loader": "^2.1.0",
... и убрал старые:
- "babel-core": "^6.26.0",
- "babel-loader": "^6.4.1",
- "babel-plugin-react": "^1.0.0",
- "babel-plugin-transform-es2015-destructuring": "^6.23.0",
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
- "babel-plugin-transform-runtime": "^6.23.0",
- "babel-polyfill": "^6.26.0",
- "babel-preset-es2015": "^6.24.1",
- "babel-preset-react": "^6.24.1",
- "babel-preset-stage-0": "^6.24.1",
- "css-loader": "^0.28.9",
Но теперь, когда я запускаю Jest, я получаю эту ошибку ...
TypeError: (_jestResolve || _load_jestResolve(...)).default.findNodeModule is not a function
at exports.resolve (/Users/jgallaso/Projects/3scale/porta/node_modules/jest-config/build/utils.js:67:64)
at Object.keys.map.regex (/Users/jgallaso/Projects/3scale/porta/node_modules/jest-config/build/normalize.js:649:51)
at Array.map (<anonymous>)
at Object.keys.reduce (/Users/jgallaso/Projects/3scale/porta/node_modules/jest-config/build/normalize.js:647:34)
at Array.reduce (<anonymous>)
at normalize (/Users/jgallaso/Projects/3scale/porta/node_modules/jest-config/build/normalize.js:545:24)
at readConfig (/Users/jgallaso/Projects/3scale/porta/node_modules/jest-config/build/index.js:184:68)
at getConfigs (/Users/jgallaso/Projects/3scale/porta/node_modules/jest/node_modules/jest-cli/build/cli/index.js:473:77)
at /Users/jgallaso/Projects/3scale/porta/node_modules/jest/node_modules/jest-cli/build/cli/index.js:251:23
at Generator.next (<anonymous>)