Search code examples
vue.jsnpmvuejs3netlify

Production: main@HEAD Failed Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code: 1


When I try to publish my site for the first time on Netlify, I receive these errors

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

I tried : npm install vue-lottie@latest --save. npm install --legacy-peer-deps. this method in same question : "Go to Site Settings > Build & Deploy > Continuous Deployment. Go to Build Settings > Edit Settings. Edit your Build Command to CI= npm run build (Look at the space between npm run build and =. It is very important to have it). In Publish Directory write build. etc..."


Solution

  • You're trying to use vue-lottie that wasn't updated for 6 years.
    It moreover says that the package is not compatible because it depends on Vue2 while you use Vue3.

    Btw, you should have the exact same error locally while working, this is not a Netlify issue.
    You can use vue3-lottie if you want an up-to-date package to manage your Lottie projects.