Running into issues with deploying my git repo

hey there,

I’m currently trying to deploy this git repo: GitHub - mustafakemaltoprak/Omega-Wallet: Omega Wallet is a fully functional crypto wallet built on the ETH blockchain with a minimalist design.

Now as you can see, all my important files are in the client folder.

I’m not able to deploy though, how would you go about this? It’s a react app so I’m assuming I have to tell Netlify to use npm run build?

I would appreciate some help on this a ton. Also I added NPM_FLAGS --force as an enviroment variable because it needs to use --force during the npm i process, do you think thats an issue?

thank you! :slight_smile:

What is the problem you’re facing?

the building fails, it says:

Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)

Instead of the one-liner, your deploy log, or your site name would be more helpful. That’s a generic error message which doesn’t provide any info.

this is my deploy log:

2:50:32 PM: Build ready to start
2:50:34 PM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
2:50:34 PM: build-image tag: v4.8.0
2:50:34 PM: buildbot version: d7330f24833f29d0263d28116347ab83094a2561
2:50:34 PM: Fetching cached dependencies
2:50:34 PM: Failed to fetch cache, continuing with build
2:50:34 PM: Starting to prepare the repo for build
2:50:34 PM: No cached dependencies found. Cloning fresh repo
2:50:34 PM: git clone my git repo // took out url because forum limits me to 6 per post
2:50:34 PM: Preparing Git Reference refs/heads/main
2:50:35 PM: Parsing package.json dependencies
2:50:35 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: ‘client’ versus ‘./client’ in the Netlify UI
2:50:35 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘client’ versus ‘/’ in the Netlify UI
2:50:36 PM: Starting build script
2:50:36 PM: Installing dependencies
2:50:36 PM: Python version set to 2.7
2:50:36 PM: Downloading and installing node v16.15.1…
2:50:37 PM: Downloading https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz
2:50:37 PM: Computing checksum with sha256sum
2:50:37 PM: Checksums matched!
2:50:40 PM: Now using node v16.15.1 (npm v8.11.0)
2:50:40 PM: Started restoring cached build plugins
2:50:40 PM: Finished restoring cached build plugins
2:50:40 PM: Attempting ruby version 2.7.2, read from environment
2:50:41 PM: Using ruby version 2.7.2
2:50:41 PM: Using PHP version 8.0
2:50:42 PM: No npm workspaces detected
2:50:42 PM: Started restoring cached node modules
2:50:42 PM: Finished restoring cached node modules
2:50:42 PM: Installing NPM modules using NPM version 8.11.0
2:50:43 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2:50:43 PM: npm WARN config location in the cache, and they are managed by
2:50:43 PM: npm WARN config [cacache](took out url because forum limits me to 6 per post).
2:50:43 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2:50:43 PM: npm WARN config location in the cache, and they are managed by
2:50:43 PM: npm WARN config [cacache]took out url because forum limits me to 6 per post).
2:50:43 PM: npm WARN using --force Recommended protections disabled.
2:50:44 PM: npm WARN ERESOLVE overriding peer dependency
2:50:44 PM: npm WARN While resolving: typewriter-effect@2.18.2
2:50:44 PM: npm WARN Found: react@18.1.0
2:50:44 PM: npm WARN node_modules/react
2:50:44 PM: npm WARN react@"^18.1.0" from the root project
2:50:44 PM: npm WARN 8 more (@testing-library/react, react-dom, react-redux, …)
2:50:44 PM: npm WARN
2:50:44 PM: npm WARN Could not resolve dependency:
2:50:44 PM: npm WARN peer react@“17.x” from typewriter-effect@2.18.2
2:50:44 PM: npm WARN node_modules/typewriter-effect
2:50:44 PM: npm WARN typewriter-effect@"^2.18.2" from the root project
2:50:44 PM: npm WARN
2:50:44 PM: npm WARN Conflicting peer dependency: react@17.0.2
2:50:44 PM: npm WARN node_modules/react
2:50:44 PM: npm WARN peer react@“17.x” from typewriter-effect@2.18.2
2:50:44 PM: npm WARN node_modules/typewriter-effect
2:50:44 PM: npm WARN typewriter-effect@"^2.18.2" from the root project
2:50:44 PM: npm WARN ERESOLVE overriding peer dependency
2:50:44 PM: npm WARN While resolving: typewriter-effect@2.18.2
2:50:44 PM: npm WARN Found: react-dom@18.1.0
2:50:44 PM: npm WARN node_modules/react-dom
2:50:44 PM: npm WARN react-dom@"^18.1.0" from the root project
2:50:44 PM: npm WARN 4 more (@testing-library/react, react-redux, react-router-dom, react-toastify)
2:50:44 PM: npm WARN
2:50:44 PM: npm WARN Could not resolve dependency:
2:50:44 PM: npm WARN peer react-dom@“17.x” from typewriter-effect@2.18.2
2:50:44 PM: npm WARN node_modules/typewriter-effect
2:50:44 PM: npm WARN typewriter-effect@"^2.18.2" from the root project
2:50:44 PM: npm WARN
2:50:44 PM: npm WARN Conflicting peer dependency: react-dom@17.0.2
2:50:44 PM: npm WARN node_modules/react-dom
2:50:44 PM: npm WARN peer react-dom@“17.x” from typewriter-effect@2.18.2
2:50:44 PM: npm WARN node_modules/typewriter-effect
2:50:44 PM: npm WARN typewriter-effect@"^2.18.2" from the root project
2:50:55 PM: npm WARN deprecated source-map-resolve@0.6.0: See GitHub - lydell/source-map-resolve: [DEPRECATED] Resolve the source map and/or sources for a generated file.
2:51:06 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
2:51:14 PM: added 1476 packages, and audited 1477 packages in 31s
2:51:14 PM: 221 packages are looking for funding
2:51:14 PM: run npm fund for details
2:51:14 PM: 6 high severity vulnerabilities
2:51:14 PM: To address all issues (including breaking changes), run:
2:51:14 PM: npm audit fix --force
2:51:14 PM: Run npm audit for details.
2:51:14 PM: NPM modules installed
2:51:14 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2:51:14 PM: npm WARN config location in the cache, and they are managed by
2:51:14 PM: npm WARN config [cacache](took out url because forum limits me to 6 per post).
2:51:14 PM: Started restoring cached go cache
2:51:14 PM: Finished restoring cached go cache
2:51:14 PM: Installing Go version 1.17
2:51:20 PM: unset GOOS;
2:51:20 PM: unset GOARCH;
2:51:20 PM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.17.linux.amd64’;
2:51:20 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.17.linux.amd64/bin:${PATH}";
2:51:20 PM: go version >&2;
2:51:20 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.17.linux.amd64.env"
2:51:20 PM: go version go1.17 linux/amd64
2:51:20 PM: Installing missing commands
2:51:20 PM: Verify run directory
2:51:22 PM: ​
2:51:22 PM: ────────────────────────────────────────────────────────────────
2:51:22 PM: Netlify Build
2:51:22 PM: ────────────────────────────────────────────────────────────────
2:51:22 PM: ​
2:51:22 PM: ❯ Version
2:51:22 PM: @netlify/build 27.1.3
2:51:22 PM: ​
2:51:22 PM: ❯ Flags
2:51:22 PM: baseRelDir: true
2:51:22 PM: buildId: 62a5e118a32b4d6354b0e059
2:51:22 PM: deployId: 62a5e118a32b4d6354b0e05b
2:51:22 PM: ​
2:51:22 PM: ❯ Current directory
2:51:22 PM: /opt/build/repo/client
2:51:22 PM: ​
2:51:22 PM: ❯ Config file
2:51:22 PM: No config file was defined: using default values.
2:51:22 PM: ​
2:51:22 PM: ❯ Context
2:51:22 PM: production
2:51:22 PM: ​
2:51:22 PM: ────────────────────────────────────────────────────────────────
2:51:22 PM: 1. Build command from Netlify app
2:51:22 PM: ────────────────────────────────────────────────────────────────
2:51:22 PM: ​
2:51:22 PM: $ npm run build
2:51:22 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2:51:22 PM: npm WARN config location in the cache, and they are managed by
2:51:22 PM: npm WARN config [cacache](took out url because forum limits me to 6 per post).
2:51:22 PM: > client@0.1.0 build
2:51:22 PM: > react-scripts build
2:51:24 PM: Creating an optimized production build…
2:51:50 PM:
2:51:50 PM: Treating warnings as errors because process.env.CI = true.
2:51:50 PM: Most CI servers set it automatically.
2:51:50 PM:
2:51:50 PM: Failed to compile.
2:51:50 PM:
2:51:50 PM: src/AccountBalance.js
2:51:50 PM: Line 1:23: ‘useDispatch’ is defined but never used no-unused-vars
2:51:50 PM: Line 69:9: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
2:51:50 PM: src/CreateWalletPage.js
2:51:50 PM: Line 39:9: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
2:51:50 PM: src/Dropdown.js
2:51:50 PM: Line 8:9: The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: eslint-plugin-jsx-a11y/anchor-is-valid.md at 287854abd066704e2a9964da597e7ab7f6f7e2ad · jsx-eslint/eslint-plugin-jsx-a11y · GitHub jsx-a11y/anchor-is-valid
2:51:50 PM: Line 16:9: The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: eslint-plugin-jsx-a11y/anchor-is-valid.md at 287854abd066704e2a9964da597e7ab7f6f7e2ad · jsx-eslint/eslint-plugin-jsx-a11y · GitHub jsx-a11y/anchor-is-valid
2:51:50 PM: src/HomePage.js
2:51:50 PM: Line 17:7: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
2:51:50 PM: src/ImportWalletPage.js
2:51:50 PM: Line 37:9: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
2:51:50 PM: ​
2:51:50 PM: ────────────────────────────────────────────────────────────────
2:51:50 PM: “build.command” failed
2:51:50 PM: ────────────────────────────────────────────────────────────────
2:51:50 PM: ​
2:51:50 PM: Error message
2:51:50 PM: Command failed with exit code 1: npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
2:51:50 PM: ​
2:51:50 PM: Error location
2:51:50 PM: In Build command from Netlify app:
2:51:50 PM: npm run build
2:51:50 PM: ​
2:51:50 PM: Resolved config
2:51:50 PM: build:
2:51:50 PM: base: /opt/build/repo/client
2:51:50 PM: command: npm run build
2:51:50 PM: commandOrigin: ui
2:51:50 PM: environment:
2:51:50 PM: - NPM_FLAGS
2:51:50 PM: - REACT_APP_INFURA_KEY
2:51:50 PM: publish: /opt/build/repo/client
2:51:50 PM: publishOrigin: ui
2:51:51 PM: Caching artifacts
2:51:51 PM: Started saving node modules
2:51:51 PM: Finished saving node modules
2:51:51 PM: Started saving build plugins
2:51:51 PM: Finished saving build plugins
2:51:51 PM: Started saving pip cache
2:51:51 PM: Finished saving pip cache
2:51:51 PM: Started saving emacs cask dependencies
2:51:51 PM: Finished saving emacs cask dependencies
2:51:51 PM: Started saving maven dependencies
2:51:51 PM: Finished saving maven dependencies
2:51:51 PM: Started saving boot dependencies
2:51:51 PM: Finished saving boot dependencies
2:51:51 PM: Started saving rust rustup cache
2:51:51 PM: Finished saving rust rustup cache
2:51:51 PM: Started saving go dependencies
2:51:52 PM: Finished saving go dependencies
2:51:53 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:51:53 PM: Creating deploy upload records
2:51:53 PM: Failing build: Failed to build site
2:51:54 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
2:51:54 PM: Finished processing build request in 1m20.095082231s

Change your build command to CI= npm run build.

I did. The website builds now but it says:

Page Not Found

Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site.

Back to our site

If this is your site, and you weren’t expecting a 404 for this path, please visit Netlify’s “page not found” support guide for troubleshooting tips.

Mind you that it worked with importing the build folder manually the first two times, but my third try doing it manually its just stuck in the building phase, which is why I tried doing it with git now

You need to change your publish folder: Netlify App

You can do that here: Netlify App and the value should be build.

1 Like

it worked, thank you