"dependency error" after ejecting from a typescript template
Created by: Avivhdr
Describe the bug
Steps:
➜ npx create-react-app my-app --template typescript
➜ cd my-app
➜ npm run eject
Error in log
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
Full log
➜ my-app git:(master) npm run eject
> my-app@0.1.0 eject
> react-scripts eject
NOTE: Create React App 2+ supports TypeScript, Sass, CSS Modules and more without ejecting: https://reactjs.org/blog/2018/10/01/create-react-app-v2.html
✔ Are you sure you want to eject? This action is permanent. … yes
Ejecting...
Copying files into /Users/avivhadar/dev/private/2-playground/my-app
Adding /config/env.js to the project
Adding /config/getHttpsConfig.js to the project
Adding /config/modules.js to the project
Adding /config/paths.js to the project
Adding /config/pnpTs.js to the project
Adding /config/webpack.config.js to the project
Adding /config/webpackDevServer.config.js to the project
Adding /config/jest/babelTransform.js to the project
Adding /config/jest/cssTransform.js to the project
Adding /config/jest/fileTransform.js to the project
Adding /scripts/build.js to the project
Adding /scripts/start.js to the project
Adding /scripts/test.js to the project
Updating the dependencies
Removing react-scripts from dependencies
Adding @babel/core to dependencies
Adding @pmmmwh/react-refresh-webpack-plugin to dependencies
Adding @svgr/webpack to dependencies
Adding @typescript-eslint/eslint-plugin to dependencies
Adding @typescript-eslint/parser to dependencies
Adding babel-eslint to dependencies
Adding babel-jest to dependencies
Adding babel-loader to dependencies
Adding babel-plugin-named-asset-import to dependencies
Adding babel-preset-react-app to dependencies
Adding bfj to dependencies
Adding camelcase to dependencies
Adding case-sensitive-paths-webpack-plugin to dependencies
Adding css-loader to dependencies
Adding dotenv to dependencies
Adding dotenv-expand to dependencies
Adding eslint to dependencies
Adding eslint-config-react-app to dependencies
Adding eslint-plugin-flowtype to dependencies
Adding eslint-plugin-import to dependencies
Adding eslint-plugin-jest to dependencies
Adding eslint-plugin-jsx-a11y to dependencies
Adding eslint-plugin-react to dependencies
Adding eslint-plugin-react-hooks to dependencies
Adding eslint-plugin-testing-library to dependencies
Adding eslint-webpack-plugin to dependencies
Adding file-loader to dependencies
Adding fs-extra to dependencies
Adding html-webpack-plugin to dependencies
Adding identity-obj-proxy to dependencies
Adding jest to dependencies
Adding jest-circus to dependencies
Adding jest-resolve to dependencies
Adding jest-watch-typeahead to dependencies
Adding mini-css-extract-plugin to dependencies
Adding optimize-css-assets-webpack-plugin to dependencies
Adding pnp-webpack-plugin to dependencies
Adding postcss-flexbugs-fixes to dependencies
Adding postcss-loader to dependencies
Adding postcss-normalize to dependencies
Adding postcss-preset-env to dependencies
Adding postcss-safe-parser to dependencies
Adding prompts to dependencies
Adding react-app-polyfill to dependencies
Adding react-dev-utils to dependencies
Adding react-refresh to dependencies
Adding resolve to dependencies
Adding resolve-url-loader to dependencies
Adding sass-loader to dependencies
Adding semver to dependencies
Adding style-loader to dependencies
Adding terser-webpack-plugin to dependencies
Adding ts-pnp to dependencies
Adding url-loader to dependencies
Adding webpack to dependencies
Adding webpack-dev-server to dependencies
Adding webpack-manifest-plugin to dependencies
Adding workbox-webpack-plugin to dependencies
Updating the scripts
Replacing "react-scripts start" with "node scripts/start.js"
Replacing "react-scripts build" with "node scripts/build.js"
Replacing "react-scripts test" with "node scripts/test.js"
Configuring package.json
Adding Jest configuration
Adding Babel preset
Running npm install...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @babel/core@7.12.3
npm ERR! node_modules/@babel/core
npm ERR! @babel/core@"7.12.3" from the root project
npm ERR! peer @babel/core@"^7.0.0" from @babel/helper-compilation-targets@7.15.4
npm ERR! node_modules/@babel/helper-compilation-targets
npm ERR! @babel/helper-compilation-targets@"^7.13.0" from @babel/helper-define-polyfill-provider@0.2.3
npm ERR! node_modules/@babel/helper-define-polyfill-provider
npm ERR! @babel/helper-define-polyfill-provider@"^0.2.2" from babel-plugin-polyfill-corejs2@0.2.2
npm ERR! node_modules/babel-plugin-polyfill-corejs2
npm ERR! babel-plugin-polyfill-corejs2@"^0.2.2" from @babel/preset-env@7.15.4
npm ERR! node_modules/@babel/preset-env
npm ERR! 2 more (babel-plugin-polyfill-corejs3, babel-plugin-polyfill-regenerator)
npm ERR! @babel/helper-compilation-targets@"^7.14.5" from @babel/plugin-proposal-object-rest-spread@7.14.7
npm ERR! node_modules/@babel/plugin-proposal-object-rest-spread
npm ERR! @babel/plugin-proposal-object-rest-spread@"^7.14.7" from @babel/preset-env@7.15.4
npm ERR! node_modules/@babel/preset-env
npm ERR! @babel/preset-env@"^7.12.1" from @svgr/webpack@5.5.0
npm ERR! node_modules/@svgr/webpack
npm ERR! 1 more (workbox-build)
npm ERR! 1 more (@babel/preset-env)
npm ERR! 2 more (@babel/preset-env, @babel/preset-env)
npm ERR! 109 more (@babel/helper-create-class-features-plugin, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @babel/core@"^7.13.0" from @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.15.4
npm ERR! node_modules/@babel/preset-env/node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
npm ERR! @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@"^7.15.4" from @babel/preset-env@7.15.4
npm ERR! node_modules/@babel/preset-env
npm ERR! @babel/preset-env@"^7.12.1" from @svgr/webpack@5.5.0
npm ERR! node_modules/@svgr/webpack
npm ERR! @svgr/webpack@"5.5.0" from the root project
npm ERR! 1 more (react-scripts)
npm ERR! 1 more (workbox-build)
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/avivhadar/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/avivhadar/.npm/_logs/2021-09-08T14_28_23_916Z-debug.log
Ejected successfully!
Staged ejected files for commit.
Please consider sharing why you ejected in this survey:
http://goo.gl/forms/Bi6CZjk1EqsdelXk1
Environment
Environment Info:
current version of create-react-app: 4.0.3 running from /Users/avivhadar/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app
System: OS: macOS 11.5.2 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Binaries: Node: 16.4.2 - /usr/local/bin/node Yarn: Not Found npm: 7.18.1 - /usr/local/bin/npm Browsers: Chrome: 93.0.4577.63 Edge: Not Found Firefox: 91.0.2 Safari: 14.1.2 npmPackages: react: ^17.0.2 => 17.0.2 react-dom: ^17.0.2 => 17.0.2 react-scripts: Not Found npmGlobalPackages: create-react-app: Not Found