当我第一次尝试在 Netlify 上发布我的网站时,我收到这些错误
7:24:28 PM: build-image version: 3d3c7e8b4321e2c1a54a2c4584fb46ba742b1630 (focal)
7:24:28 PM: buildbot version: 72ed9578274f76ae72cdce4c5312615aeecc32fb
7:24:28 PM: Building without cache
7:24:28 PM: Starting to prepare the repo for build
7:24:29 PM: No cached dependencies found. Cloning fresh repo
7:24:29 PM: git clone --filter=blob:none https://github.com/Essama-Official/Fictum.Web
7:24:29 PM: Preparing Git Reference refs/heads/main
7:24:31 PM: Starting to install dependencies
7:24:32 PM: Python version set to 3.8
7:24:32 PM: Attempting Ruby version 2.7.2, read from environment
7:24:32 PM: Using Ruby version 2.7.2
7:24:33 PM: Started restoring cached go cache
7:24:33 PM: Finished restoring cached go cache
7:24:35 PM: go version go1.19.13 linux/amd64
7:24:36 PM: Using PHP version 8.0
7:24:37 PM: v18.20.2 is already installed.
7:24:38 PM: Now using node v18.20.2 (npm v10.5.0)
7:24:38 PM: Enabling Node.js Corepack
7:24:38 PM: Started restoring cached build plugins
7:24:38 PM: Finished restoring cached build plugins
7:24:38 PM: Started restoring cached corepack dependencies
7:24:38 PM: Finished restoring cached corepack dependencies
7:24:38 PM: No npm workspaces detected
7:24:38 PM: Started restoring cached node modules
7:24:38 PM: Finished restoring cached node modules
7:24:38 PM: Installing npm packages using npm version 10.5.0
7:24:39 PM: Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code: 1
7:24:39 PM: npm ERR! code ERESOLVE
7:24:39 PM: npm ERR! ERESOLVE could not resolve
7:24:39 PM: npm ERR!
7:24:39 PM: npm ERR! While resolving: [email protected]
7:24:39 PM: npm ERR! Found: [email protected]
7:24:39 PM: npm ERR! node_modules/vue
7:24:39 PM: npm ERR! vue@"^3.3.11" from the root project
7:24:39 PM: npm ERR! peer vue@"^3.2.25" from @vitejs/[email protected]
7:24:39 PM: npm ERR! node_modules/@vitejs/plugin-vue
7:24:39 PM: npm ERR! dev @vitejs/plugin-vue@"^4.5.2" from the root project
7:24:39 PM: npm ERR! 4 more (@vue/server-renderer, vue-chartjs, vue-router, vuex)
7:24:39 PM: npm ERR!
7:24:39 PM: npm ERR! Could not resolve dependency:
7:24:39 PM: npm ERR! peer vue@"^2.5.16" from [email protected]
7:24:39 PM: npm ERR! node_modules/vue-lottie
7:24:39 PM: npm ERR! vue-lottie@"^0.2.1" from the root project
7:24:39 PM: npm ERR!
7:24:39 PM: npm ERR! Conflicting peer dependency: [email protected]
7:24:39 PM: npm ERR! node_modules/vue
7:24:39 PM: npm ERR! peer vue@"^2.5.16" from [email protected]
7:24:39 PM: npm ERR! node_modules/vue-lottie
7:24:39 PM: npm ERR! vue-lottie@"^0.2.1" from the root project
7:24:39 PM: npm ERR!
7:24:39 PM: npm ERR! Fix the upstream dependency conflict, or retry
7:24:39 PM: npm ERR! this command with --force or --legacy-peer-deps
7:24:39 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
7:24:39 PM: npm ERR!
7:24:39 PM: npm ERR!
7:24:39 PM: npm ERR! For a full report see:
7:24:39 PM: npm ERR! /opt/buildhome/.npm/_logs/2024-05-14T17_24_38_567Z-eresolve-report.txt
7:24:39 PM: npm ERR! A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2024-05-14T17_24_38_567Z-debug-0.log
7:24:39 PM: Error during npm install
7:24:39 PM: Failing build: Failed to install dependencies
我尝试过: npm 安装 vue-lottie@latest --save。 npm install --legacy-peer-deps。 在同一问题中使用此方法:“转到站点设置 > 构建和部署 > 持续部署。 转到构建设置 > 编辑设置。 将构建命令编辑为 CI= npm run build (查看 npm run build 和 = 之间的空格。它非常重要)。 在发布目录中写入 build.等等...”
您正在尝试使用 6 年未更新的 vue-lottie。
它还说该包不兼容,因为它依赖于 Vue2,而你使用 Vue3。
顺便说一句,您在工作时应该在本地遇到完全相同的错误,这不是 Netlify 问题。
如果您想要最新的软件包来管理您的 Lottie 项目,您可以使用 vue3-lottie。