npx create-react-app fails while executing yarnpkg on big sur
Asked Answered
H

2

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)
Hassi answered 17/11, 2020 at 16:11 Comment(2)
Please do get back and self-answer if you've solved this @HassiSnore
Is there any workout?Tragic
T
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.

Tragic answered 6/3, 2021 at 11:16 Comment(0)
C
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.

Curvilinear answered 17/11, 2020 at 21:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.