pradel / create-react-app-esbuild

Use esbuild in your create-react-app for faster compilation, development and tests
MIT License
563 stars 35 forks source link

Does not install - unable to resolve dependency tree #56

Closed rickevry closed 2 years ago

rickevry commented 2 years ago

It is currently not possible to install craco-esbuild.

Steps to reproduce:

  1. Using node v 16.6.2

H:\nvm list

  1. Create new project with npm init

  2. Try to install: H:\test_clean>npm install --save-dev craco-esbuild @craco/craco npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: test_clean@1.0.0 npm ERR! Found: react-scripts@4.0.3 npm ERR! node_modules/react-scripts npm ERR! peer react-scripts@"^4.0.0" from @craco/craco@6.4.3 npm ERR! node_modules/@craco/craco npm ERR! dev @craco/craco@"" from the root project npm ERR! peer @craco/craco@"^6.0.0" from craco-esbuild@0.5.0 npm ERR! node_modules/craco-esbuild npm ERR! dev craco-esbuild@"" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react-scripts@"^5.0.0" from craco-esbuild@0.5.0 npm ERR! node_modules/craco-esbuild npm ERR! dev craco-esbuild@"*" 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.

mikementor commented 2 years ago

If it'll help somebody

I ended up just copying index.js in craco-esbuild.js and importing plugin from file const CracoEsbuildPlugin = require('./craco-esbuild'); instead of npm install craco-esbuild

also installed npm i esbuild-loader

pradel commented 2 years ago

Fixed in the last version