8

I've found a few posts on this already but none of the existing solutions seem to work.

  • OSX Big Sur
  • yarn 1.22.10
  • npm 7.0.11
  • I updated xcode developer tools.
  • I deleted npm cache
  • I removed .npm and .yarnrc folders

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)
Gregg
  • 34,973
  • 19
  • 109
  • 214

2 Answers2

1

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.

mhellmeier
  • 1,982
  • 1
  • 22
  • 35
0

Had the exact same issue with a Vue project. I am using OSX Catalina and npm 7.0.8.

My error was resolved with a post found here: https://forum.quasar-framework.org/topic/6258/errors-updating-to-v2/5

With the answer of FrankM:


Check your index.template.html.
Replace htmlWebpackPlugin.options.ctx.mode with ctx.mode


Maybe this helps and you have a similar entry anywhere in your project.

s-frei
  • 1