React app not deploying due to missing dependencies

This is the name of my site " compassionate-bardeen-ecacc5 ". I am facing an issue in deploying my site.

1:46:20 AM: Build ready to start
1:46:21 AM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
1:46:21 AM: build-image tag: v3.6.1
1:46:21 AM: buildbot version: 28b3358b4c94ec0a3a8c81b155535f3f8c2745f1
1:46:21 AM: Fetching cached dependencies
1:46:21 AM: Failed to fetch cache, continuing with build
1:46:21 AM: Starting to prepare the repo for build
1:46:22 AM: No cached dependencies found. Cloning fresh repo
1:46:22 AM: git clone https://github.com/6605295/covid-tracker
1:46:23 AM: Preparing Git Reference refs/heads/main
1:46:24 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: β€˜build’ versus β€˜build/’ in the Netlify UI
1:46:25 AM: Starting build script
1:46:25 AM: Installing dependencies
1:46:25 AM: Python version set to 2.7
1:46:26 AM: v12.18.0 is already installed.
1:46:26 AM: Now using node v12.18.0 (npm v6.14.4)
1:46:26 AM: Started restoring cached build plugins
1:46:26 AM: Finished restoring cached build plugins
1:46:26 AM: Attempting ruby version 2.7.1, read from environment
1:46:28 AM: Using ruby version 2.7.1
1:46:28 AM: Using PHP version 5.6
1:46:28 AM: Started restoring cached node modules
1:46:28 AM: Finished restoring cached node modules
1:46:28 AM: Started restoring cached yarn cache
1:46:28 AM: Finished restoring cached yarn cache
1:46:28 AM: Installing yarn at version 1.22.4
1:46:28 AM: Installing Yarn!
1:46:28 AM: > Downloading tarball…
1:46:28 AM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz β†’ /tmp/yarn.tar.gz.6lpTQREUlZ
1:46:28 AM: % Total % Received % Xferd Average Speed Time Time Time Current
1:46:28 AM: Dload Upload Total Spent Left Speed
1:46:28 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
1:46:28 AM: 100 80 100 80 0 0 403 0 --:–:-- --:–:-- --:–:-- 404
1:46:28 AM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
1:46:28 AM: 100 93 100 93 0 0 180 0 --:–:-- --:–:-- --:–:-- 550
1:46:29 AM: 100 625 100 625 0 0 817 0 --:–:-- --:–:-- --:–:-- 817
1:46:29 AM: 100 1215k 100 1215k 0 0 1068k 0 0:00:01 0:00:01 --:–:-- 1068k
1:46:29 AM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc β†’ /tmp/yarn.tar.gz.6lpTQREUlZ.asc
1:46:29 AM: 100 84 100 84 0 0 911 0 --:–:-- --:–:-- --:–:-- 911
1:46:29 AM: 100 97 100 97 0 0 810 0 --:–:-- --:–:-- --:–:-- 810
1:46:29 AM: 100 629 100 629 0 0 4196 0 --:–:-- --:–:-- --:–:-- 4196
1:46:29 AM: 0 1028 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
1:46:29 AM: 100 1028 100 1028 0 0 6387 0 --:–:-- --:–:-- --:–:-- 1003k
1:46:29 AM: > Verifying integrity…
1:46:29 AM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
1:46:29 AM: gpg: Good signature from β€œYarn Packaging yarn@dan.cx”
1:46:29 AM: gpg: Note: This key has expired!
1:46:29 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
1:46:29 AM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
1:46:29 AM: > GPG signature looks good
1:46:29 AM: > Extracting to ~/.yarn…
1:46:29 AM: > Adding to $PATH…
1:46:30 AM: > Successfully installed Yarn 1.22.4! Please open another terminal where the yarn command will now be available.
1:46:30 AM: Installing NPM modules using Yarn version 1.22.4
1:46:31 AM: yarn install v1.22.4
1:46:31 AM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
1:46:31 AM: [1/4] Resolving packages…
1:46:32 AM: warning react-scripts > webpack-dev-server > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
1:46:32 AM: [2/4] Fetching packages…
1:46:53 AM: info fsevents@2.3.1: The platform β€œlinux” is incompatible with this module.
1:46:53 AM: info β€œfsevents@2.3.1” is an optional dependency and failed compatibility check. Excluding it from installation.
1:46:53 AM: info fsevents@1.2.13: The platform β€œlinux” is incompatible with this module.
1:46:53 AM: info β€œfsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.
1:46:53 AM: [3/4] Linking dependencies…
1:46:53 AM: warning " > @testing-library/user-event@12.6.3" has unmet peer dependency β€œ@testing-library/dom@>=7.21.4”.
1:46:53 AM: warning " > react-leaflet@3.1.0" has unmet peer dependency β€œleaflet@^1.7.1”.
1:46:53 AM: warning β€œreact-leaflet > @react-leaflet/core@1.0.2” has unmet peer dependency β€œleaflet@^1.7.1”.
1:46:53 AM: warning β€œreact-scripts > @typescript-eslint/eslint-plugin > tsutils@3.20.0” has unmet peer dependency β€œtypescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta”.
1:47:05 AM: [4/4] Building fresh packages…
1:47:06 AM: success Saved lockfile.
1:47:06 AM: Done in 35.80s.
1:47:06 AM: NPM modules installed using Yarn
1:47:07 AM: Started restoring cached go cache
1:47:07 AM: Finished restoring cached go cache
1:47:07 AM: go version go1.14.4 linux/amd64
1:47:07 AM: go version go1.14.4 linux/amd64
1:47:07 AM: Installing missing commands
1:47:07 AM: Verify run directory
1:47:08 AM: ​
1:47:08 AM: ────────────────────────────────────────────────────────────────
1:47:08 AM: Netlify Build
1:47:08 AM: ────────────────────────────────────────────────────────────────
1:47:08 AM: ​
1:47:08 AM: ❯ Version
1:47:08 AM: @netlify/build 8.4.0
1:47:08 AM: ​
1:47:08 AM: ❯ Flags
1:47:08 AM: deployId: 601b0b9bf69c1a0089a72cb4
1:47:08 AM: mode: buildbot
1:47:08 AM: ​
1:47:08 AM: ❯ Current directory
1:47:08 AM: /opt/build/repo
1:47:08 AM: ​
1:47:08 AM: ❯ Config file
1:47:08 AM: No config file was defined: using default values.
1:47:08 AM: ​
1:47:08 AM: ❯ Context
1:47:08 AM: production
1:47:08 AM: ​
1:47:08 AM: ────────────────────────────────────────────────────────────────
1:47:08 AM: 1. Build command from Netlify app
1:47:08 AM: ────────────────────────────────────────────────────────────────
1:47:08 AM: ​
1:47:08 AM: $ yarn build
1:47:09 AM: yarn run v1.22.4
1:47:09 AM: $ react-scripts build
1:47:10 AM: Creating an optimized production build…
1:47:13 AM: Failed to compile.
1:47:13 AM:
1:47:13 AM: ./src/App.js
1:47:13 AM: Cannot find module: β€˜leaflet/dist/leaflet.css’. Make sure this package is installed.
1:47:13 AM: You can install this package by running: yarn add leaflet/dist/leaflet.css.
1:47:13 AM: error Command failed with exit code 1.
1:47:13 AM: info Visit yarn run | Yarn for documentation about this command.
1:47:13 AM: ​
1:47:13 AM: ────────────────────────────────────────────────────────────────
1:47:13 AM: β€œbuild.command” failed
1:47:13 AM: ────────────────────────────────────────────────────────────────
1:47:13 AM: ​
1:47:13 AM: Error message
1:47:13 AM: Command failed with exit code 1: yarn build
1:47:13 AM: ​
1:47:13 AM: Error location
1:47:13 AM: In Build command from Netlify app:
1:47:13 AM: yarn build
1:47:13 AM: ​
1:47:13 AM: Resolved config
1:47:13 AM: build:
1:47:13 AM: command: yarn build
1:47:13 AM: commandOrigin: ui
1:47:13 AM: publish: /opt/build/repo/build
1:47:13 AM: Caching artifacts
1:47:13 AM: Started saving node modules
1:47:13 AM: Finished saving node modules
1:47:13 AM: Started saving build plugins
1:47:13 AM: Finished saving build plugins
1:47:13 AM: Started saving yarn cache
1:47:13 AM: Finished saving yarn cache
1:47:13 AM: Started saving pip cache
1:47:13 AM: Finished saving pip cache
1:47:13 AM: Started saving emacs cask dependencies
1:47:13 AM: Finished saving emacs cask dependencies
1:47:13 AM: Started saving maven dependencies
1:47:13 AM: Finished saving maven dependencies
1:47:13 AM: Started saving boot dependencies
1:47:13 AM: Finished saving boot dependencies
1:47:13 AM: Started saving rust rustup cache
1:47:13 AM: Finished saving rust rustup cache
1:47:13 AM: Started saving go dependencies
1:47:13 AM: Finished saving go dependencies
1:47:16 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:47:16 AM: Failing build: Failed to build site
1:47:16 AM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
1:47:16 AM: Finished processing build request in 54.710852306s

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile:

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!

1 Like

I haven’t used leaflet myself but it might be as easy as yarn add leaflet to solve this error.

2 Likes

@snorkypie Thanks a lot man. You are great. error Solved !