首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >npx创建反应应用程序在大sur上执行yarnpkg时失败。

npx创建反应应用程序在大sur上执行yarnpkg时失败。
EN

Stack Overflow用户
提问于 2020-11-17 16:11:56
回答 2查看 3.2K关注 0票数 8

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

  • OSX
  • 纱1.22.10
  • 7.0.11
  • I更新了xcode开发工具
  • 我删除了npm缓存H 210H 111我删除了.npm和.yarnrc文件夹H 212F 213

然后尝试用npx create-react-app启动一个新的React应用程序,并得到以下内容:

代码语言:javascript
复制
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.

日志文件有:

代码语言:javascript
复制
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)
EN

回答 2

Stack Overflow用户

发布于 2021-03-06 11:16:31

macOS Big也有同样的问题。我通常使用brew来安装我的软件包。简单地升级软件包解决了我的问题:

代码语言:javascript
复制
brew upgrade

之后

代码语言:javascript
复制
brew cleanup

您可能需要在npm完成升级后重新启动brew

票数 1
EN

Stack Overflow用户

发布于 2020-11-17 21:39:42

Vue项目也有同样的问题。我正在使用和npm 7.0.8。

我的错误通过在这里找到的一个帖子解决了:https://forum.quasar-framework.org/topic/6258/errors-updating-to-v2/5

FrankM的回答

检查一下你的index.template.html。

htmlWebpackPlugin.options.ctx.mode替换为ctx.mode

也许这会有所帮助,而且您在项目中的任何地方都有类似的条目。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64879002

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档