Modele not Found? What?

I am developing a react application. When I want to publish my application, I get a module not found error as follows. Pls help me.

7:51:04 PM: build-image version: 4c0c1cadee6a31c9bb8d824514030009c4c05c6a (focal)
7:51:04 PM: build-image tag: v4.15.0
7:51:04 PM: buildbot version: 8e21f3a6f94b4bf664f0a5ce69b751fdfc9791bd
7:51:05 PM: Building without cache
7:51:05 PM: Starting to prepare the repo for build
7:51:05 PM: No cached dependencies found. Cloning fresh repo
7:51:05 PM: git clone https://github.com/celil-vural/Pau_Genc_Yazilimcilar
7:51:06 PM: Preparing Git Reference refs/heads/master
7:51:06 PM: Parsing package.json dependencies
7:51:07 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: β€˜β€™ versus β€˜./’ in the Netlify UI
7:51:07 PM: Section completed: initializing
7:51:07 PM: Starting build script
7:51:07 PM: Installing dependencies
7:51:07 PM: Python version set to 2.7
7:51:08 PM: v16.18.1 is already installed.
7:51:08 PM: Now using node v16.18.1 (npm v8.19.2)
7:51:08 PM: Enabling node corepack
7:51:08 PM: Started restoring cached build plugins
7:51:08 PM: Finished restoring cached build plugins
7:51:08 PM: Attempting ruby version 2.7.2, read from environment
7:51:09 PM: Using ruby version 2.7.2
7:51:09 PM: Using PHP version 8.0
7:51:09 PM: No npm workspaces detected
7:51:09 PM: Started restoring cached node modules
7:51:09 PM: Finished restoring cached node modules
7:51:09 PM: Installing NPM modules using NPM version 8.19.2
7:51:14 PM: npm WARN deprecated w3c-hr-time@1.0.2: Use your platform’s native performance.now() and performance.timeOrigin.npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: Array.prototype.sort() - JavaScript | MDN
7:51:17 PM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
7:51:24 PM: added 1580 packages, and audited 1581 packages in 14s
7:51:24 PM: 228 packages are looking for funding
7:51:24 PM: run npm fund for details
7:51:24 PM: 6 high severity vulnerabilities
7:51:24 PM: To address all issues (including breaking changes), run:
7:51:24 PM: npm audit fix --force
7:51:24 PM: Run npm audit for details.
7:51:24 PM: NPM modules installed
7:51:24 PM: Creating package sha
7:51:24 PM: Started restoring cached go cache
7:51:24 PM: Finished restoring cached go cache
7:51:25 PM: Installing Go version 1.19.3 (requested 1.19.x)
7:51:30 PM: unset GOOS;
7:51:30 PM: unset GOARCH;
7:51:30 PM: export GOROOT=β€˜/opt/buildhome/.gimme/versions/go1.19.3.linux.amd64’;
7:51:30 PM: export PATH=β€œ/opt/buildhome/.gimme/versions/go1.19.3.linux.amd64/bin:${PATH}”;
7:51:30 PM: go version >&2;
7:51:30 PM: export GIMME_ENV=β€œ/opt/buildhome/.gimme/env/go1.19.3.linux.amd64.env”
7:51:30 PM: go version go1.19.3 linux/amd64
7:51:30 PM: Detected 1 framework(s)
7:51:30 PM: β€œcreate-react-app” at version β€œ5.0.1”
7:51:30 PM: Installing missing commands
7:51:30 PM: Verify run directory
7:51:31 PM: ​
7:51:31 PM: ────────────────────────────────────────────────────────────────
7:51:31 PM: Netlify Build
7:51:31 PM: ────────────────────────────────────────────────────────────────
7:51:31 PM: ​
7:51:31 PM: ❯ Version
7:51:31 PM: @netlify/build 28.4.0
7:51:31 PM: ​
7:51:31 PM: ❯ Flags
7:51:31 PM: baseRelDir: true
7:51:31 PM: buildId: 6383957714b0af0f2d74e138
7:51:31 PM: deployId: 6383957714b0af0f2d74e13a
7:51:31 PM: ​
7:51:31 PM: ❯ Current directory
7:51:31 PM: /opt/build/repo
7:51:31 PM: ​
7:51:31 PM: ❯ Config file
7:51:31 PM: No config file was defined: using default values.
7:51:31 PM: ​
7:51:31 PM: ❯ Context
7:51:31 PM: production
7:51:31 PM: ​
7:51:31 PM: ────────────────────────────────────────────────────────────────
7:51:31 PM: 1. Build command from Netlify app
7:51:31 PM: ────────────────────────────────────────────────────────────────
7:51:31 PM: ​
7:51:31 PM: $ CI= npm run build
7:51:31 PM: > genc_yazilimcilar@0.1.0 build
7:51:31 PM: > react-scripts build
7:51:32 PM: Creating an optimized production build…
7:51:43 PM: Failed to compile.
7:51:43 PM:
7:51:43 PM: Module not found: Error: Can’t resolve β€˜path’ in '/opt/build/repo/node_modules/fs-extra/lib/empty’BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
7:51:43 PM: This is no longer the case. Verify if you need this module and configure a polyfill for it.
7:51:43 PM: If you want to include a polyfill, you need to:
7:51:43 PM: - add a fallback β€˜resolve.fallback: { β€œpath”: require.resolve(β€œpath-browserify”) }’
7:51:43 PM: - install β€˜path-browserify’
7:51:43 PM: If you don’t want to include a polyfill, you can use an empty module like this: resolve.fallback: { β€œpath”: false }
7:51:43 PM: ​
7:51:43 PM: ────────────────────────────────────────────────────────────────
7:51:43 PM: β€œbuild.command” failed
7:51:43 PM: ────────────────────────────────────────────────────────────────
7:51:43 PM: ​
7:51:43 PM: Error message
7:51:43 PM: Command failed with exit code 1: CI= npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
7:51:43 PM: ​
7:51:43 PM: Error location
7:51:43 PM: In Build command from Netlify app:
7:51:43 PM: CI= npm run build
7:51:43 PM: ​
7:51:43 PM: Resolved config
7:51:43 PM: build:
7:51:43 PM: base: /opt/build/repo
7:51:43 PM: command: CI= npm run build
7:51:43 PM: commandOrigin: ui
7:51:43 PM: publish: /opt/build/repo/build
7:51:43 PM: publishOrigin: ui
7:51:43 PM: Caching artifacts
7:51:43 PM: Started saving node modules
7:51:43 PM: Finished saving node modules
7:51:44 PM: Creating deploy upload records
7:51:43 PM: Started saving build plugins
7:51:43 PM: Finished saving build plugins
7:51:43 PM: Started saving pip cache
7:51:43 PM: Finished saving pip cache
7:51:44 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)
7:51:43 PM: Started saving emacs cask dependencies
7:51:43 PM: Finished saving emacs cask dependencies
7:51:43 PM: Started saving maven dependencies
7:51:43 PM: Finished saving maven dependencies
7:51:43 PM: Started saving boot dependencies
7:51:43 PM: Finished saving boot dependencies
7:51:43 PM: Started saving rust rustup cache
7:51:43 PM: Finished saving rust rustup cache
7:51:43 PM: Started saving go dependencies
7:51:43 PM: Finished saving go dependencies
7:51:44 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:51:44 PM: Failing build: Failed to build site
7:51:44 PM: Finished processing build request in 39.47774822s

This part of the error mentions what the problem is. Did you try that?

Yeah, but don’t work it or i could not do it

Could you show what you’ve tried?

1 Like

I solved the problem by giving up the import. Thank you for taking care of me.