NETLIFY -NPM ERR! Eresolve无法解决

发布于 2025-02-09 13:13:13 字数 5218 浏览 0 评论 0原文

我目前正在与Gatsbyjs一起从事一个项目。我已经将其安装到了无线电话中,并且没有任何问题。该站点在本地运行良好,但是当我尝试部署该站点以进行网络时,我会发现此错误:

    5:54:31 PM: Build ready to start
5:54:33 PM: build-image version: a49edbc55fc722f80f6b85963a5060f8d043a844 (focal)
5:54:33 PM: build-image tag: v4.8.1
5:54:33 PM: buildbot version: f89dd42aa70d76d1da992dc3fa004a4c745208bc
5:54:33 PM: Fetching cached dependencies
5:54:33 PM: Failed to fetch cache, continuing with build
5:54:33 PM: Starting to prepare the repo for build
5:54:33 PM: No cached dependencies found. Cloning fresh repo
5:54:33 PM: git clone https://github.com/mont266/tw_react
5:54:34 PM: Preparing Git Reference refs/heads/main
5:54:34 PM: Parsing package.json dependencies
5:54:35 PM: Starting build script
5:54:35 PM: Installing dependencies
5:54:35 PM: Python version set to 2.7
5:54:36 PM: v16.15.1 is already installed.
5:54:36 PM: Now using node v16.15.1 (npm v8.11.0)
5:54:36 PM: Started restoring cached build plugins
5:54:36 PM: Finished restoring cached build plugins
5:54:36 PM: Attempting ruby version 2.7.2, read from environment
5:54:37 PM: Using ruby version 2.7.2
5:54:37 PM: Using PHP version 8.0
5:54:38 PM: No npm workspaces detected
5:54:38 PM: Started restoring cached node modules
5:54:38 PM: Finished restoring cached node modules
5:54:38 PM: Installing NPM modules using NPM version 8.11.0
5:54:38 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
5:54:38 PM: npm WARN config location in the cache, and they are managed by
5:54:38 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
5:54:39 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
5:54:39 PM: npm WARN config location in the cache, and they are managed by
5:54:39 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
5:54:42 PM: npm ERR! code ERESOLVE
5:54:42 PM: npm ERR! ERESOLVE could not resolve
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! While resolving: [email protected]
5:54:42 PM: Creating deploy upload records
5:54:42 PM: npm ERR! Found: [email protected]
5:54:42 PM: npm ERR! node_modules/react
5:54:42 PM: npm ERR!   react@"^17.0.2" from the root project
5:54:42 PM: npm ERR!   peer react@"^16.8.6 || ^17.0.0 || ^18.0.0" from @contentful/[email protected]
5:54:42 PM: npm ERR!   node_modules/@contentful/rich-text-react-renderer
5:54:42 PM: npm ERR!     @contentful/rich-text-react-renderer@"^15.12.1" from [email protected]
5:54:42 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
5:54:42 PM: npm ERR!     node_modules/gatsby-source-contentful
5:54:42 PM: npm ERR!       gatsby-source-contentful@"^7.14.0" from the root project
5:54:42 PM: npm ERR!   22 more (@gatsbyjs/reach-router, @loadable/component, ...)
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! Could not resolve dependency:
5:54:42 PM: npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from [email protected]
5:54:42 PM: npm ERR! node_modules/react-owl-carousel3
5:54:42 PM: npm ERR!   react-owl-carousel3@"^2.2.5" from the root project
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! Conflicting peer dependency: [email protected]
5:54:42 PM: npm ERR! node_modules/react
5:54:42 PM: npm ERR!   peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from [email protected]
5:54:42 PM: npm ERR!   node_modules/react-owl-carousel3
5:54:42 PM: npm ERR!     react-owl-carousel3@"^2.2.5" from the root project
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! Fix the upstream dependency conflict, or retry
5:54:42 PM: npm ERR! this command with --force, or --legacy-peer-deps
5:54:42 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
5:54:42 PM: npm ERR! A complete log of this run can be found in:
5:54:42 PM: npm ERR!     /opt/buildhome/.npm/_logs/2022-06-20T16_54_39_021Z-debug-0.log
5:54:42 PM: Error during NPM install
5:54:42 PM: Build was terminated: Build script returned non-zero exit code: 1
5:54:42 PM: Failing build: Failed to build site
5:54:43 PM: Finished processing build request in 10.014825654s

我尝试了盖茨比清洁,我尝试删除node_modules并重新安装,同样是尝试重新安装遗产依赖性。当地没有任何问题,有人会建议什么可能导致这种情况不在Netlify上吗?

谢谢

I am currently working on a project with GatsbyJS. I've installed contentful to it as a headerlessCMS and didn't have any issues. The site runs fine locally but when I try to deploy the site to Netlify I get this error:

    5:54:31 PM: Build ready to start
5:54:33 PM: build-image version: a49edbc55fc722f80f6b85963a5060f8d043a844 (focal)
5:54:33 PM: build-image tag: v4.8.1
5:54:33 PM: buildbot version: f89dd42aa70d76d1da992dc3fa004a4c745208bc
5:54:33 PM: Fetching cached dependencies
5:54:33 PM: Failed to fetch cache, continuing with build
5:54:33 PM: Starting to prepare the repo for build
5:54:33 PM: No cached dependencies found. Cloning fresh repo
5:54:33 PM: git clone https://github.com/mont266/tw_react
5:54:34 PM: Preparing Git Reference refs/heads/main
5:54:34 PM: Parsing package.json dependencies
5:54:35 PM: Starting build script
5:54:35 PM: Installing dependencies
5:54:35 PM: Python version set to 2.7
5:54:36 PM: v16.15.1 is already installed.
5:54:36 PM: Now using node v16.15.1 (npm v8.11.0)
5:54:36 PM: Started restoring cached build plugins
5:54:36 PM: Finished restoring cached build plugins
5:54:36 PM: Attempting ruby version 2.7.2, read from environment
5:54:37 PM: Using ruby version 2.7.2
5:54:37 PM: Using PHP version 8.0
5:54:38 PM: No npm workspaces detected
5:54:38 PM: Started restoring cached node modules
5:54:38 PM: Finished restoring cached node modules
5:54:38 PM: Installing NPM modules using NPM version 8.11.0
5:54:38 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
5:54:38 PM: npm WARN config location in the cache, and they are managed by
5:54:38 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
5:54:39 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
5:54:39 PM: npm WARN config location in the cache, and they are managed by
5:54:39 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
5:54:42 PM: npm ERR! code ERESOLVE
5:54:42 PM: npm ERR! ERESOLVE could not resolve
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! While resolving: [email protected]
5:54:42 PM: Creating deploy upload records
5:54:42 PM: npm ERR! Found: [email protected]
5:54:42 PM: npm ERR! node_modules/react
5:54:42 PM: npm ERR!   react@"^17.0.2" from the root project
5:54:42 PM: npm ERR!   peer react@"^16.8.6 || ^17.0.0 || ^18.0.0" from @contentful/[email protected]
5:54:42 PM: npm ERR!   node_modules/@contentful/rich-text-react-renderer
5:54:42 PM: npm ERR!     @contentful/rich-text-react-renderer@"^15.12.1" from [email protected]
5:54:42 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
5:54:42 PM: npm ERR!     node_modules/gatsby-source-contentful
5:54:42 PM: npm ERR!       gatsby-source-contentful@"^7.14.0" from the root project
5:54:42 PM: npm ERR!   22 more (@gatsbyjs/reach-router, @loadable/component, ...)
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! Could not resolve dependency:
5:54:42 PM: npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from [email protected]
5:54:42 PM: npm ERR! node_modules/react-owl-carousel3
5:54:42 PM: npm ERR!   react-owl-carousel3@"^2.2.5" from the root project
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! Conflicting peer dependency: [email protected]
5:54:42 PM: npm ERR! node_modules/react
5:54:42 PM: npm ERR!   peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from [email protected]
5:54:42 PM: npm ERR!   node_modules/react-owl-carousel3
5:54:42 PM: npm ERR!     react-owl-carousel3@"^2.2.5" from the root project
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! Fix the upstream dependency conflict, or retry
5:54:42 PM: npm ERR! this command with --force, or --legacy-peer-deps
5:54:42 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
5:54:42 PM: npm ERR!
5:54:42 PM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
5:54:42 PM: npm ERR! A complete log of this run can be found in:
5:54:42 PM: npm ERR!     /opt/buildhome/.npm/_logs/2022-06-20T16_54_39_021Z-debug-0.log
5:54:42 PM: Error during NPM install
5:54:42 PM: Build was terminated: Build script returned non-zero exit code: 1
5:54:42 PM: Failing build: Failed to build site
5:54:43 PM: Finished processing build request in 10.014825654s

I have tried gatsby clean, I have tried deleting node_modules and reinstalling aswell as tried reinstalling legacy dependancies. There's no issues locally, would anyone be able to advise as to what might be causing this to not run on Netlify?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文