我已经找到了一些关于这方面的帖子,但现有的解决方案似乎都不起作用。
H 210H 111我删除了.npm和.yarnrc文件夹H 212F 213然后尝试用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)发布于 2021-03-06 11:16:31
macOS Big也有同样的问题。我通常使用brew来安装我的软件包。简单地升级软件包解决了我的问题:
brew upgrade之后
brew cleanup您可能需要在npm完成升级后重新启动brew。
发布于 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
也许这会有所帮助,而且您在项目中的任何地方都有类似的条目。
https://stackoverflow.com/questions/64879002
复制相似问题