gpt4 book ai didi

reactjs - npx create-react-app 在 big sur 上执行 yarnpkg 时失败

转载 作者:行者123 更新时间:2023-12-03 13:41:15 31 4
gpt4 key购买 nike

我已经找到了一些关于此的帖子,但现有的解决方案似乎都不起作用。

  • OSX 大苏尔
  • yarn 1.22.10
  • npm 7.0.11
  • 我更新了 xcode 开发人员工具。
  • 我删除了 npm 缓存
  • 我删除了 .npm 和 .yarnrc 文件夹

  • 然后尝试使用 npx create-react-app 启动一个新的 React 应用程序并获得以下信息:
    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.
    日志文件有:
    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)

    最佳答案

    在 macOS Big Sur 上遇到了同样的问题。我一般用brew安装我的软件包。只需升级软件包即可为我解决:

    brew upgrade
    之后
    brew cleanup
    您可能需要重新启动 npm之后 brew升级完毕。

    关于reactjs - npx create-react-app 在 big sur 上执行 yarnpkg 时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64879002/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com