【问题标题】:How to resolve a mobx dependency issue when pushing a github action to github?将 github 操作推送到 github 时如何解决 mobx 依赖问题?
【发布时间】:2022-07-28 22:12:37
【问题描述】:

我正在尝试使用 cypress 创建一个 github 操作。我的问题是我的应用程序安装时存在 mobx 依赖问题。我试图通过降级 mobx-react-form 和 mobx-react-form-devtools 来解决依赖问题本身,但后来我遇到了其他依赖问题。

有没有办法解决这个依赖问题或者强制 github 忽略它?

我知道您可以通过包含“--force”或“--legacy-peer-deps”来强制安装 npm,但这在这里不起作用。提前致谢!

Run cypress-io/github-action@v4
/usr/local/bin/npm ci
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: mobx-react-form-devtools@1.11.0
npm ERR! Found: mobx-react-form@2.0.2
npm ERR! node_modules/mobx-react-form
npm ERR!   mobx-react-form@"2.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer mobx-react-form@"^1.x.x" from mobx-react-form-devtools@1.11.0
npm ERR! node_modules/mobx-react-form-devtools
npm ERR!   dev mobx-react-form-devtools@"1.11.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: mobx-react-form@1.39.1
npm ERR! node_modules/mobx-react-form
npm ERR!   peer mobx-react-form@"^1.x.x" from mobx-react-form-devtools@1.11.0
npm ERR!   node_modules/mobx-react-form-devtools
npm ERR!     dev mobx-react-form-devtools@"1.11.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/runner/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-07-19T19_22_13_749Z-debug-0.log
Error: The process '/usr/local/bin/npm' failed with exit code 1

【问题讨论】:

    标签: reactjs github cypress github-actions


    【解决方案1】:

    通过在 cypress 运行命令中添加 install-command 选项,我能够绕过依赖问题:

        - name: Cypress run 
        uses: cypress-io/github-action@v4
        with:
          install-command: npm install --force
          browser: electron
          start: npm start
    

    【讨论】:

      猜你喜欢
      • 2020-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-15
      • 2017-04-18
      • 2018-10-14
      • 1970-01-01
      • 2022-11-25
      相关资源
      最近更新 更多