EliEladElrom / cra-template-must-have-libraries

✨ A starter CRA professional React v17 project with must-have ReactJS libraries including TypeScript, SCSS, Redux, Toolkit, Material-UI, Styled Components, React Router, Jest & Enzym, Folder structure, Generate templates, ESLint, Prettier, Recoil
https://elielrom.com
MIT License
100 stars 22 forks source link

Create app from the template doesn't work #59

Open bitsal opened 2 years ago

bitsal commented 2 years ago

Versions: NPM - 8.19.2

Run command:

npx create-react-app web --template cra-template-must-have-libraries

Error log:

Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: web@0.1.0
npm ERR! Found: @typescript-eslint/eslint-plugin@3.8.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR!   @typescript-eslint/eslint-plugin@"3.8.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/eslint-plugin@"2.x" from eslint-config-react-app@5.2.1
npm ERR! node_modules/eslint-config-react-app
npm ERR!   eslint-config-react-app@"5.2.1" from the root project
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 /home/user/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2022-10-02T18_15_58_263Z-debug-0.log
`npm install --no-audit --save @babel/helper-builder-react-jsx@7.16.0 @material-ui/core@4.11.4 @material-ui/icons@4.11.2 @octokit/core@3.5.1 @octokit/plugin-request-log@1.0.2 @reduxjs/toolkit@1.6.0 @testing-library/jest-dom@5.14.1 @testing-library/react@9.3.2 @testing-library/user-event@7.1.2 @types/classnames@2.2.10 @types/enzyme@3.10.8 @types/jest@26.0.9 @types/node@14.0.27 @types/react@16.9.44 @types/react-dom@16.9.8 @types/react-helmet@6.1.0 @types/react-redux@7.1.9 @types/react-router-dom@5.1.5 @types/sinon@10.0.6 @types/styled-components@5.1.2 @typescript-eslint/eslint-plugin@3.8.0 @typescript-eslint/parser@3.8.0 @wojtekmaj/enzyme-adapter-react-17@0.6.3 add@2.0.6 babel-eslint@10.1.0 classnames@2.2.6 enzyme@3.11.0 enzyme-to-json@3.6.1 eslint-config-airbnb-typescript@12.3.1 eslint-config-prettier@8.3.0 eslint-config-react-app@5.2.1 eslint-import-resolver-typescript@2.2.0 eslint-loader@4.0.2 eslint-plugin-flowtype@6.1.0 eslint-plugin-import@2.24.2 eslint-plugin-jest@26.1.1 eslint-plugin-jsx-a11y@6.3.1 eslint-plugin-prettier@3.1.4 eslint-plugin-react@7.29.2 eslint-plugin-react-hooks@4.0.8 eslint-webpack-plugin@2.1.0 istanbul-reports@3.0.2 moment@2.29.1 node-sass@4.14.1 nyc@15.1.0 prettier-eslint@13.0.0 prettier-eslint-cli@5.0.0 prop-types@15.7.2 react@17.0.2 react-dom@17.0.2 react-helmet@6.1.0 react-redux@7.2.6 react-router-dom@5.2.0 react-scripts@3.4.1 react-test-renderer@16.14.0 react-uuid@1.0.2 recoil@0.6.1 redux@4.1.2 scss-loader@0.0.1 serve@11.3.2 sinon@9.2.0 styled-components@5.1.1 ts-jest@26.4.3 typescript@4.2.3 typings-for-scss-modules-loader@1.5.1 yarn@1.22.17 cra-bundle-analyzer@0.1.0 husky@4.3.0 jest@27.4.3 react-snap@1.23.0 @types/expect-puppeteer@4.4.7 @types/jest-environment-puppeteer@4.4.1 @types/puppeteer@5.4.4 jest-puppeteer@6.0.2 puppeteer@12.0.1` failed
crzyjcky commented 1 year ago

The cra-template prefix is not required.

npx create-react-app react-d3-hello-world --template must-have-libraries
KenACollins commented 1 year ago

I have Yarn 1.22.19, Node 16.19.1, npm 9.6.1, and npx 9.6.1 versions installed. Neither of these commands work any more:

yarn create react-app react-d3-hello-world --template must-have-libraries
npx create-react-app react-d3-hello-world --template must-have-libraries

Yarn issues a ton of warnings about unsupported template package versions and then ends with the following lines:

info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.11.2.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Git Repositories\\personal\\react-d3-hello-world\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts cra-template-must-have-libraries --cwd C:\Git Repositories\personal\react-d3-hello-world has failed.

Deleting generated file... package.json
Done.
error Command failed.
Exit code: 1

NPX issues the same errors as noted in @bitsal's original comment.

I checked the author's website but he does not acknowledge any issues with his React with D3 book having outdated tech stack setup information. This is certainly a frustrating way to try and learn D3 when I can't get the starter 'Hello World' app up and running.