I've found a few posts on this already but none of the existing solutions seem to work.
And then trying to start a new React app with npx create-react-app
and getting the following:
error An unexpected error occurred: "expected workspace package to exist for \"eslint\"".
info If you think this is a bug, please open a bug report with the information provided in "/Users/gdboling/Projects/BalancedComp/clients/packages/rewards/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 --cwd /Users/gdboling/Projects/BalancedComp/clients/packages/rewards has failed.
The log file has:
26 verbose stack Error: command failed
26 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
26 verbose stack at ChildProcess.emit (node:events:329:20)
26 verbose stack at maybeClose (node:internal/child_process:1055:16)
26 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
If you are concerned with the size of it, you do not need to run create-react-app every time. You can make a react project yourself quite easily and by doing so you have much more control and understanding of your project.
Create React App npx on the first line is not a typo — it's a package runner tool that comes with npm 5.2+. Create React App doesn't handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any backend you want.
Got the same problem on macOS Big Sur. I generally use brew
to install my packages. Simply upgrading the packages solved it for me:
brew upgrade
and afterwards
brew cleanup
You may need to restart npm
after brew
finished upgrading.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With