Error: ENOENT: no such file or directory, open '/opt/build/repo/images/logo.svg'

My site works fine on a live server, but fails to build and I cannot therefore deploy it to netlify.

The error seems to be here: Error: ENOENT: no such file or directory, open ‘/opt/build/repo/images/logo.svg’

The file does exist in the repository but it is not detected somehow.

I do not understand why this is not working.

Netlify site name: [parampashkulv2.netlify.app]

Github repo: [GitHub - Parampashkul/parampashkulify: First project with HTML/CSS]

Build Log: **

3:51:39 PM: Build ready to start
3:51:41 PM: build-image version: d03efc9bc7b65d83035572f6dba444f85407dd60
3:51:41 PM: build-image tag: v3.7.5
3:51:41 PM: buildbot version: 6dd06f64b3b0b51f07678bbd16c7e5a748905aed
3:51:41 PM: Fetching cached dependencies
3:51:42 PM: Failed to fetch cache, continuing with build
3:51:42 PM: Starting to prepare the repo for build
3:51:42 PM: No cached dependencies found. Cloning fresh repo
3:51:42 PM: git clone GitHub - Parampashkul/parampashkulify: First project with HTML/CSS
3:51:43 PM: Preparing Git Reference refs/heads/main
3:51:44 PM: Parsing package.json dependencies
3:51:45 PM: Starting build script
3:51:45 PM: Installing dependencies
3:51:45 PM: Python version set to 2.7
3:51:47 PM: v12.18.0 is already installed.
3:51:47 PM: Now using node v12.18.0 (npm v6.14.4)
3:51:47 PM: Started restoring cached build plugins
3:51:47 PM: Finished restoring cached build plugins
3:51:47 PM: Attempting ruby version 2.7.1, read from environment
3:51:49 PM: Using ruby version 2.7.1
3:51:49 PM: Using PHP version 5.6
3:51:49 PM: Started restoring cached node modules
3:51:49 PM: Finished restoring cached node modules
3:51:50 PM: Installing NPM modules using NPM version 6.14.4
3:52:04 PM: > deasync@0.1.21 install /opt/build/repo/node_modules/deasync
3:52:04 PM: > node ./build.js
3:52:04 PM: linux-x64-node-12 exists; testing
3:52:04 PM: Binary is fine; exiting
3:52:04 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/core-js
3:52:04 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
3:52:04 PM: > parcel-bundler@1.12.5 postinstall /opt/build/repo/node_modules/parcel-bundler
3:52:04 PM: > node -e “console.log(’\u001b[35m\u001b[1mLove Parcel? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/parcel/donate\u001b[0m’)”
3:52:04 PM: Love Parcel? You can now donate to our open collective:
3:52:04 PM: > Contribute to Parcel - Open Collective
3:52:05 PM: npm WARN Parampashkulify@1.0.0 No description
3:52:05 PM: npm WARN Parampashkulify@1.0.0 No repository field.
3:52:05 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
3:52:05 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
3:52:05 PM: added 767 packages from 461 contributors and audited 769 packages in 14.749s
3:52:06 PM: 46 packages are looking for funding
3:52:06 PM: run npm fund for details
3:52:06 PM: found 0 vulnerabilities
3:52:06 PM: NPM modules installed
3:52:06 PM: Started restoring cached go cache
3:52:06 PM: Finished restoring cached go cache
3:52:06 PM: go version go1.14.4 linux/amd64
3:52:06 PM: go version go1.14.4 linux/amd64
3:52:06 PM: Installing missing commands
3:52:06 PM: Verify run directory
3:52:08 PM: ​
3:52:08 PM: ────────────────────────────────────────────────────────────────
3:52:08 PM: Netlify Build
3:52:08 PM: ────────────────────────────────────────────────────────────────
3:52:08 PM: ​
3:52:08 PM: ❯ Version
3:52:08 PM: @netlify/build 11.10.0
3:52:08 PM: ​
3:52:08 PM: ❯ Flags
3:52:08 PM: deployId: 6099487b65927f008fae6e85
3:52:08 PM: ​
3:52:08 PM: ❯ Current directory
3:52:08 PM: /opt/build/repo
3:52:08 PM: ​
3:52:08 PM: ❯ Config file
3:52:08 PM: No config file was defined: using default values.
3:52:08 PM: ​
3:52:08 PM: ❯ Context
3:52:08 PM: production
3:52:08 PM: ​
3:52:08 PM: ────────────────────────────────────────────────────────────────
3:52:08 PM: 1. Build command from Netlify app
3:52:08 PM: ────────────────────────────────────────────────────────────────
3:52:08 PM: ​
3:52:08 PM: $ parcel build index.html
3:52:13 PM: :rotating_light: /opt/build/repo/images/logo.svg: ENOENT: no such file or directory, open ‘/opt/build/repo/images/logo.svg’
3:52:13 PM: Error: ENOENT: no such file or directory, open ‘/opt/build/repo/images/logo.svg’
3:52:14 PM: ​
3:52:14 PM: ────────────────────────────────────────────────────────────────
3:52:14 PM: “build.command” failed
3:52:14 PM: ────────────────────────────────────────────────────────────────
3:52:14 PM: ​
3:52:14 PM: Error message
3:52:14 PM: Command failed with exit code 1: parcel build index.html
3:52:14 PM: ​
3:52:14 PM: Error location
3:52:14 PM: In Build command from Netlify app:
3:52:14 PM: parcel build index.html
3:52:14 PM: ​
3:52:14 PM: Resolved config
3:52:14 PM: build:
3:52:14 PM: command: parcel build index.html
3:52:14 PM: commandOrigin: ui
3:52:14 PM: publish: /opt/build/repo/dist
3:52:14 PM: Caching artifacts
3:52:14 PM: Started saving node modules
3:52:14 PM: Finished saving node modules
3:52:14 PM: Started saving build plugins
3:52:14 PM: Finished saving build plugins
3:52:14 PM: Started saving pip cache
3:52:14 PM: Finished saving pip cache
3:52:14 PM: Started saving emacs cask dependencies
3:52:14 PM: Finished saving emacs cask dependencies
3:52:14 PM: Started saving maven dependencies
3:52:14 PM: Finished saving maven dependencies
3:52:14 PM: Started saving boot dependencies
3:52:14 PM: Finished saving boot dependencies
3:52:14 PM: Started saving rust rustup cache
3:52:14 PM: Finished saving rust rustup cache
3:52:14 PM: Started saving go dependencies
3:52:14 PM: Finished saving go dependencies
3:52:17 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:52:17 PM: Creating deploy upload records
3:52:17 PM: Failing build: Failed to build site
3:52:17 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
3:52:17 PM: Finished processing build request in 35.779576s

**

Your folder is named Images and not images. Case of file name matters. Either rename the folder or change the import statement.

1 Like

Thank you hrishikesh

I made the adjustment and it still didn’t work. I went to look at my code and i noticed inconsistencies with it using “images/…” and “Images/…”. I was taught that code in html/css is not case-sensitive but it is when using netlify in conjunction with it so I made all the code consistent in my HTML (using “images/…” in all lines that required). It still didn’t work so I also did the same with my CSS code and I no longer had that error. Then I came across another problem: " [Error: tree.render is not a function]". I found a solution online to use the following build command: “parcel build --no-minify index.html” and now it finally works.

1 Like

Hey there, @Sasan :wave:

Thank you for sharing your solution with us! It will definitely be beneficial for future Forums members who encounter something similar. :netliconfetti:

Hi, i have a similar issue but it’s slightly different from Sasan’s.
Github repo [https://github.com/NaveenJc10/Naveen]
Could someone please help me to solve this issue. Thank you

12:07:21 PM: Build ready to start
12:07:23 PM: build-image version: 0582042f4fc261adc7bd8333f34884959c577302
12:07:23 PM: build-image tag: v3.7.6
12:07:23 PM: buildbot version: cb3d235979bae64f617d34524cb2e8a9de68153f
12:07:23 PM: Fetching cached dependencies
12:07:23 PM: Failed to fetch cache, continuing with build
12:07:23 PM: Starting to prepare the repo for build
12:07:24 PM: No cached dependencies found. Cloning fresh repo
12:07:24 PM: git clone https://github.com/NaveenJc10/Naveen
12:07:25 PM: Preparing Git Reference refs/heads/main
12:07:25 PM: Parsing package.json dependencies
12:07:27 PM: Starting build script
12:07:27 PM: Installing dependencies
12:07:27 PM: Python version set to 2.7
12:07:28 PM: v12.18.0 is already installed.
12:07:29 PM: Now using node v12.18.0 (npm v6.14.4)
12:07:29 PM: Started restoring cached build plugins
12:07:29 PM: Finished restoring cached build plugins
12:07:29 PM: Attempting ruby version 2.7.1, read from environment
12:07:31 PM: Using ruby version 2.7.1
12:07:31 PM: Using PHP version 5.6
12:07:31 PM: Started restoring cached node modules
12:07:31 PM: Finished restoring cached node modules
12:07:31 PM: Installing NPM modules using NPM version 6.14.4
12:07:47 PM: > deasync@0.1.21 install /opt/build/repo/node_modules/deasync
12:07:47 PM: > node ./build.js
12:07:47 PM: linux-x64-node-12 exists; testing
12:07:47 PM: Binary is fine; exiting
12:07:47 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/core-js
12:07:47 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
12:07:47 PM: > parcel-bundler@1.12.4 postinstall /opt/build/repo/node_modules/parcel-bundler
12:07:47 PM: > node -e “console.log(’\u001b[35m\u001b[1mLove Parcel? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/parcel/donate\u001b[0m’)”
12:07:47 PM: Love Parcel? You can now donate to our open collective:
12:07:47 PM: > Contribute to Parcel - Open Collective
12:07:48 PM: npm WARN Naveen@1.0.0 No description
12:07:48 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
12:07:48 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:07:48 PM: added 766 packages from 461 contributors and audited 768 packages in 15.721s
12:07:48 PM: 46 packages are looking for funding
12:07:48 PM: run npm fund for details
12:07:48 PM: found 68 vulnerabilities (67 moderate, 1 high)
12:07:48 PM: run npm audit fix to fix them, or npm audit for details
12:07:48 PM: NPM modules installed
12:07:49 PM: Started restoring cached go cache
12:07:49 PM: Finished restoring cached go cache
12:07:49 PM: go version go1.14.4 linux/amd64
12:07:49 PM: go version go1.14.4 linux/amd64
12:07:49 PM: Installing missing commands
12:07:49 PM: Verify run directory
12:07:51 PM: ​
12:07:51 PM: ────────────────────────────────────────────────────────────────
12:07:51 PM: Netlify Build
12:07:51 PM: ────────────────────────────────────────────────────────────────
12:07:51 PM: ​
12:07:51 PM: ❯ Version
12:07:51 PM: @netlify/build 11.18.1
12:07:51 PM: ​
12:07:51 PM: ❯ Flags
12:07:51 PM: deployId: 60ac77f9aa712200a9963afb
12:07:51 PM: ​
12:07:51 PM: ❯ Current directory
12:07:51 PM: /opt/build/repo
12:07:51 PM: ​
12:07:51 PM: ❯ Config file
12:07:51 PM: No config file was defined: using default values.
12:07:51 PM: ​
12:07:51 PM: ❯ Context
12:07:51 PM: production
12:07:51 PM: ​
12:07:51 PM: ────────────────────────────────────────────────────────────────
12:07:51 PM: 1. Build command from Netlify app
12:07:51 PM: ────────────────────────────────────────────────────────────────
12:07:51 PM: ​
12:07:51 PM: $ parcel build --no-minify index.html
12:07:53 PM: :rotating_light: /opt/build/repo/images/logo.svg: Invalid Version: undefined
12:07:53 PM: at new SemVer (/opt/build/repo/node_modules/@babel/preset-env/node_modules/semver/semver.js:314:11)
12:07:53 PM: at compare (/opt/build/repo/node_modules/@babel/preset-env/node_modules/semver/semver.js:647:10)
12:07:53 PM: at lt (/opt/build/repo/node_modules/@babel/preset-env/node_modules/semver/semver.js:688:10)
12:07:53 PM: at /opt/build/repo/node_modules/@babel/preset-env/lib/index.js:274:22
12:07:53 PM: at Object.default (/opt/build/repo/node_modules/@babel/helper-plugin-utils/lib/index.js:22:12)
12:07:53 PM: at getEnvPlugins (/opt/build/repo/node_modules/parcel-bundler/src/transforms/babel/env.js:62:34)
12:07:53 PM: at getEnvConfig (/opt/build/repo/node_modules/parcel-bundler/src/transforms/babel/env.js:12:25)
12:07:53 PM: at async getBabelConfig (/opt/build/repo/node_modules/parcel-bundler/src/transforms/babel/config.js:32:19)
12:07:53 PM: at async babelTransform (/opt/build/repo/node_modules/parcel-bundler/src/transforms/babel/transform.js:6:16)
12:07:53 PM: at async JSAsset.pretransform (/opt/build/repo/node_modules/parcel-bundler/src/assets/JSAsset.js:83:5)
12:07:54 PM: ​
12:07:54 PM: ────────────────────────────────────────────────────────────────
12:07:54 PM: “build.command” failed
12:07:54 PM: ────────────────────────────────────────────────────────────────
12:07:54 PM: ​
12:07:54 PM: Error message
12:07:54 PM: Command failed with exit code 1: parcel build --no-minify index.html
12:07:54 PM: ​
12:07:54 PM: Error location
12:07:54 PM: In Build command from Netlify app:
12:07:54 PM: parcel build --no-minify index.html
12:07:54 PM: ​
12:07:54 PM: Resolved config
12:07:54 PM: build:
12:07:54 PM: command: parcel build --no-minify index.html
12:07:54 PM: commandOrigin: ui
12:07:54 PM: publish: /opt/build/repo/dist
12:07:54 PM: functions:
12:07:54 PM: ‘*’: {}
12:07:54 PM: Caching artifacts
12:07:54 PM: Started saving node modules
12:07:54 PM: Finished saving node modules
12:07:54 PM: Started saving build plugins
12:07:54 PM: Finished saving build plugins
12:07:54 PM: Started saving pip cache
12:07:54 PM: Finished saving pip cache
12:07:54 PM: Started saving emacs cask dependencies
12:07:54 PM: Finished saving emacs cask dependencies
12:07:54 PM: Started saving maven dependencies
12:07:54 PM: Finished saving maven dependencies
12:07:54 PM: Started saving boot dependencies
12:07:54 PM: Finished saving boot dependencies
12:07:54 PM: Started saving rust rustup cache
12:07:54 PM: Finished saving rust rustup cache
12:07:54 PM: Started saving go dependencies
12:07:54 PM: Finished saving go dependencies
12:07:57 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:07:57 PM: Creating deploy upload records
12:07:57 PM: Failing build: Failed to build site
12:07:57 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
12:07:57 PM: Finished processing build request in 33.980133128s

Hey there, @NaveenJc10 :wave:

Thanks for reaching out, and welcome to the Netlify Forums :netliconfetti:

We will need a bit more information before we help you here. Please share the following information:

  1. Can you elaborate on what “similar issue” you are having?
  2. Can you share your Netlify site name?
  3. Can you share any debugging steps you have already taken?

Thank you :slight_smile:

Similar issue as Sasan above.
naveenjc10

Hi @NaveenJc10 :wave:

Thanks for following up. As I mentioned above, can you share the following:

  1. your Netlify site name
  2. Any debugging steps you have already taken.

Please help us help you by providing more information, links, etc! :slight_smile: