Site built with Parcel.js. It builds, but does not deploy

The site is Netlify App. (Please pardon the site content. It’s a job I’m doing).

The long story/ background/ can skip this paragraph:
I had a site, made with Parcel.js, where the build would randomly fail even if I just made a change to CSS, and I couldn’t figure out why. I deleted the site (because was going to just deploy the dist file via drag and drop). Then, I needed to switch back to the site being built with parcel (in order to be able to access environmental variables).

So, I just restarted the site again, with a build. For the build command, I’m using npx parcel src/index.html because that is what works on the local project.

It’s building the site fine, but won’t deploy.

Under “Deploys”, it says: Deploys for vibrant-shaw-d9bca5

Site deploy in progress [link]

BUILD LOG:
2:20:13 PM: Build ready to start

12:20:15 PM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal)

12:20:15 PM: build-image tag: v4.5.3

12:20:15 PM: buildbot version: baeb904a18ff040c47ba9b74273238853fc0b7a7

12:20:15 PM: Fetching cached dependencies

12:20:15 PM: Failed to fetch cache, continuing with build

12:20:15 PM: Starting to prepare the repo for build

12:20:16 PM: No cached dependencies found. Cloning fresh repo

12:20:16 PM: git clone [git repo name]

12:20:18 PM: Preparing Git Reference refs/heads/main

12:20:19 PM: Parsing package.json dependencies

12:20:19 PM: Starting build script

12:20:19 PM: Installing dependencies

12:20:19 PM: Python version set to 2.7

12:20:20 PM: Downloading and installing node v16.14.0…

12:20:20 PM: Downloading [dist]
12:20:21 PM: Computing checksum with sha256sum

12:20:21 PM: Checksums matched!

12:20:24 PM: Now using node v16.14.0 (npm v8.3.1)

12:20:24 PM: Started restoring cached build plugins

12:20:24 PM: Finished restoring cached build plugins

12:20:24 PM: Attempting ruby version 2.7.2, read from environment

12:20:26 PM: Using ruby version 2.7.2

12:20:26 PM: Using PHP version 8.0

12:20:26 PM: Started restoring cached node modules

12:20:26 PM: Finished restoring cached node modules

12:20:27 PM: Installing NPM modules using NPM version 8.3.1

12:20:28 PM: npm WARN old lockfile

12:20:28 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,

12:20:28 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.

12:20:28 PM: npm WARN old lockfile

12:20:28 PM: npm WARN old lockfile This is a one-time fix-up, please be patient…

12:20:28 PM: npm WARN old lockfile

12:20:45 PM: added 211 packages, and audited 212 packages in 17s

12:20:45 PM: 74 packages are looking for funding

12:20:45 PM: run npm fund for details

12:20:45 PM: found 0 vulnerabilities

12:20:45 PM: NPM modules installed

12:20:45 PM: Started restoring cached go cache

12:20:45 PM: Finished restoring cached go cache

12:20:45 PM: go version go1.16.5 linux/amd64

12:20:45 PM: go version go1.16.5 linux/amd64

12:20:45 PM: Installing missing commands

12:20:45 PM: Verify run directory

12:20:48 PM: ​

12:20:48 PM: ────────────────────────────────────────────────────────────────

12:20:48 PM: Netlify Build

12:20:48 PM: ────────────────────────────────────────────────────────────────

12:20:48 PM: ​

12:20:48 PM: ❯ Version

12:20:48 PM: @netlify/build 26.3.3

12:20:48 PM: ​

12:20:48 PM: ❯ Flags

12:20:48 PM: baseRelDir: true

12:20:48 PM: buildId: 6213c9cddd23a346b14dc3d1

12:20:48 PM: deployId: 6213c9cddd23a346b14dc3d3

12:20:48 PM: ​

12:20:48 PM: ❯ Current directory

12:20:48 PM: /opt/build/repo

12:20:48 PM: ​

12:20:48 PM: ❯ Config file

12:20:48 PM: No config file was defined: using default values.

12:20:48 PM: ​

12:20:48 PM: ❯ Context

12:20:48 PM: production

12:20:48 PM: ​

12:20:48 PM: ────────────────────────────────────────────────────────────────

12:20:48 PM: 1. Build command from Netlify app

12:20:48 PM: ────────────────────────────────────────────────────────────────

12:20:48 PM: ​

12:20:48 PM: $ npx parcel src/index.html

12:20:50 PM: Server running at http://localhost:1234

12:20:50 PM: Building…

12:20:51 PM: Bundling…

12:20:51 PM: Packaging & Optimizing…

12:20:52 PM: :sparkles: Built in 1.92s

:star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star:
** oh! Update. There are more logs, and then the deploy failed.**

12:50:13 PM: Build exceeded maximum allowed runtime
12:50:14 PM: :rotating_light: Build failed.
12:50:14 PM: Error: Cannot find module ‘chalk’
12:50:14 PM: Require stack:
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/utils/lib/index.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/public/Config.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/utils.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/public/Environment.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/public/Asset.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/Parcel.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/index.js
12:50:14 PM: - /opt/build/repo/node_modules/parcel/lib/cli.js
12:50:14 PM: - /opt/build/repo/node_modules/parcel/lib/bin.js
12:50:14 PM: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
12:50:14 PM: at Function.Module._load (node:internal/modules/cjs/loader:778:27)
12:50:14 PM: at Module.require (node:internal/modules/cjs/loader:1005:19)
12:50:14 PM: at require (/opt/build/repo/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
12:50:14 PM: at _chalk (/opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js:9:39)
12:50:14 PM: at /opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js:28:50
12:50:14 PM: at String.replace ()
12:50:14 PM: at markdownParser (/opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js:28:17)
12:50:14 PM: at Object.$f02d6a9d30f55938$export$2e2bcd8739ae039 (/opt/build/repo/node_modules/@parcel/utils/lib/index.js:32547:69)
12:50:14 PM: at $e2f5dd4f0f00d7a2$var$writeDiagnostic (/opt/build/repo/node_modules/@parcel/reporter-cli/lib/CLIReporter.js:7559:146) {
12:50:14 PM: code: ‘MODULE_NOT_FOUND’,
12:50:14 PM: requireStack: [
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/utils/lib/index.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/public/Config.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/utils.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/public/Environment.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/public/Asset.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/Parcel.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/index.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/parcel/lib/cli.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/parcel/lib/bin.js’
12:50:14 PM: ]
12:50:14 PM: }
12:50:14 PM: Error: Cannot find module ‘chalk’
12:50:14 PM: Require stack:
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/utils/lib/index.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/public/Config.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/utils.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/public/Environment.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/public/Asset.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/Parcel.js
12:50:14 PM: - /opt/build/repo/node_modules/@parcel/core/lib/index.js
12:50:14 PM: - /opt/build/repo/node_modules/parcel/lib/cli.js
12:50:14 PM: - /opt/build/repo/node_modules/parcel/lib/bin.js
12:50:14 PM: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
12:50:14 PM: at Function.Module._load (node:internal/modules/cjs/loader:778:27)
12:50:14 PM: at Module.require (node:internal/modules/cjs/loader:1005:19)
12:50:14 PM: at require (/opt/build/repo/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
12:50:14 PM: at _chalk (/opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js:9:39)
12:50:14 PM: at /opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js:28:50
12:50:14 PM: at String.replace ()
12:50:14 PM: at markdownParser (/opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js:28:17)
12:50:14 PM: at Object.$f02d6a9d30f55938$export$2e2bcd8739ae039 (/opt/build/repo/node_modules/@parcel/utils/lib/index.js:32547:69)
12:50:14 PM: at /opt/build/repo/node_modules/@parcel/reporter-dev-server/lib/ServerReporter.js:16334:59 {
12:50:14 PM: code: ‘MODULE_NOT_FOUND’,
12:50:14 PM: requireStack: [
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/markdown-ansi/lib/markdown-ansi.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/utils/lib/index.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/public/Config.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/utils.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/public/Environment.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/public/Asset.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/Parcel.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/@parcel/core/lib/index.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/parcel/lib/cli.js’,
12:50:14 PM: ‘/opt/build/repo/node_modules/parcel/lib/bin.js’
12:50:14 PM: ]
12:50:14 PM: }

Hey @maiya

This is not the parcel build command, this is the command to serve the site locally for development.

The parcel build command is parcel build src/index.html. Ideally, you would add this (if it isn’t already) as a build script in the package.json of the project, e.g.

"scripts": {
  "start": "parcel src/index.html",
  "build": "parcel build src/index.html"
},

Then set the Build command in the Netlify UI (or netlify.toml) to npm run build (which means you you change the build script in the package.json you don’t need to change the build command Netlify uses.)

1 Like

Thank you for that. It seems to have worked. Previously, the build was switching between working, and then not, so fingers crossed. I’lll let you know if it errors again.

Also, a quick follow-up question:
Do you know if there’s a way to access process.env variables without using a lambda function? My lambda functions are not working locally, and when I try to install the netlify-cli, I am not able to. I think there is a dependency that requires sudo and it is blocking it (need to get computer help with that). Do you know if you sign up for a paid account, if netlify will help you with these issues? Thanks again!

sudo is the linux/unix command that grants higher level privileges to a user to a computer system.

Have a look at [Support Guide] Using environment variables on Netlify correctly for more on variables.

Oh! It failed again :frowning: …twice.

I added FONT_AWESOME_KEY=test to the environment variables. I am not accessing it anywhere, but it is causing the build to fail.

FIRST FAIL

4:22:10 PM: Build ready to start
4:22:12 PM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal)
4:22:12 PM: build-image tag: v4.5.3
4:22:12 PM: buildbot version: d0d16b0f5fc4780038932c00d7b03cc901627b5d
4:22:12 PM: Building without cache
4:22:12 PM: Starting to prepare the repo for build
4:22:12 PM: No cached dependencies found. Cloning fresh repo
4:22:12 PM: git clone [git repo name]
4:22:15 PM: Preparing Git Reference refs/heads/main
4:22:15 PM: Parsing package.json dependencies
4:22:16 PM: Starting build script
4:22:16 PM: Installing dependencies
4:22:16 PM: Python version set to 2.7
4:22:17 PM: Downloading and installing node v16.14.0…
4:22:17 PM: Downloading
4:22:18 PM: Computing checksum with sha256sum
4:22:18 PM: Checksums matched!
4:22:21 PM: Now using node v16.14.0 (npm v8.3.1)
4:22:21 PM: Started restoring cached build plugins
4:22:21 PM: Finished restoring cached build plugins
4:22:21 PM: Attempting ruby version 2.7.2, read from environment
4:22:23 PM: Using ruby version 2.7.2
4:22:23 PM: Using PHP version 8.0
4:22:23 PM: Started restoring cached node modules
4:22:23 PM: Finished restoring cached node modules
4:22:24 PM: Installing NPM modules using NPM version 8.3.1
4:22:25 PM: npm WARN old lockfile
4:22:25 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
4:22:25 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
4:22:25 PM: npm WARN old lockfile
4:22:25 PM: npm WARN old lockfile This is a one-time fix-up, please be patient…
4:22:25 PM: npm WARN old lockfile
4:22:38 PM: added 211 packages, and audited 212 packages in 13s
4:22:38 PM: 74 packages are looking for funding
4:22:38 PM: run npm fund for details
4:22:38 PM: found 0 vulnerabilities
4:22:38 PM: NPM modules installed
4:22:38 PM: Started restoring cached go cache
4:22:38 PM: Finished restoring cached go cache
4:22:38 PM: go version go1.16.5 linux/amd64
4:22:38 PM: go version go1.16.5 linux/amd64
4:22:38 PM: Installing missing commands
4:22:38 PM: Verify run directory
4:22:40 PM: ​
4:22:40 PM: ────────────────────────────────────────────────────────────────
4:22:40 PM: Netlify Build
4:22:40 PM: ────────────────────────────────────────────────────────────────
4:22:40 PM: ​
4:22:40 PM: ❯ Version
4:22:40 PM: @netlify/build 26.3.3
4:22:40 PM: ​
4:22:40 PM: ❯ Flags
4:22:40 PM: baseRelDir: true
4:22:40 PM: buildId: 62140282fa42c79feead17ae
4:22:40 PM: deployId: 62140282fa42c79feead17b0
4:22:40 PM: ​
4:22:40 PM: ❯ Current directory
4:22:40 PM: /opt/build/repo
4:22:40 PM: ​
4:22:40 PM: ❯ Config file
4:22:40 PM: No config file was defined: using default values.
4:22:40 PM: ​
4:22:40 PM: ❯ Context
4:22:40 PM: production
4:22:40 PM: ​
4:22:40 PM: ────────────────────────────────────────────────────────────────
4:22:40 PM: 1. Build command from Netlify app
4:22:40 PM: ────────────────────────────────────────────────────────────────
4:22:40 PM: ​
4:22:40 PM: $ npm run build
4:22:41 PM: > monkey@1.0.0 build
4:22:41 PM: > parcel build src/index.html
4:22:42 PM: Building…
4:22:43 PM: Bundling…
4:22:43 PM: Packaging & Optimizing…
4:22:46 PM: :sparkles: Built in 5.33s
4:22:46 PM: dist/index.html 3.76 KB 2.61s
4:22:46 PM: dist/favicon.ac4740b3.ico 17.07 KB 407ms
4:22:46 PM: dist/skate-figure-an.5300f629.gif :warning: 8.42 MB 2.17s
4:22:46 PM: dist/Moneygirl0001.bbcbd66c.jpg 23.86 KB 426ms
4:22:46 PM: dist/Moneygirl0002.7313d9d5.jpg 30.27 KB 1.83s
4:22:46 PM: dist/Moneygirl0003.33e08ab7.jpg 24.94 KB 431ms
4:22:46 PM: dist/Moneygirl0004.0fb6f2e6.jpg 24.13 KB 1.83s
4:22:46 PM: dist/Moneygirl0005.01dfccf5.jpg 23.89 KB 431ms
4:22:46 PM: dist/Moneygirl0006.786f6af3.jpg 25.31 KB 1.83s
4:22:46 PM: dist/Moneygirl0007.076859bb.jpg 20.29 KB 431ms
4:22:46 PM: dist/Moneygirl0008.f3f2f492.jpg 29.67 KB 1.83s
4:22:46 PM: dist/Moneygirl0009.96372c77.jpg 22.15 KB 431ms
4:22:46 PM: dist/Moneygirl0010.171c5763.jpg 23.69 KB 1.83s
4:22:46 PM: dist/Moneygirl0011.964d2f82.jpg 28.11 KB 439ms
4:22:46 PM: dist/Moneygirl0012.6662d8de.jpg 24.14 KB 1.83s
4:22:46 PM: dist/Moneygirl0013.2cf50b76.jpg 19.06 KB 439ms
4:22:46 PM: dist/Moneygirl0014.ed2d66a9.jpg 22.28 KB 1.83s
4:22:46 PM: dist/index.f3819f6d.js 62.6 KB 3.29s
4:22:46 PM: dist/index.b3dca6dc.css 3.43 KB 2.92s
4:22:47 PM: Segmentation fault
4:22:47 PM: ​
4:22:47 PM: ────────────────────────────────────────────────────────────────
4:22:47 PM: “build.command” failed
4:22:47 PM: ────────────────────────────────────────────────────────────────
4:22:47 PM: ​
4:22:47 PM: Error message
4:22:47 PM: Command failed with exit code 139: npm run build
4:22:47 PM: ​
4:22:47 PM: Error location
4:22:47 PM: In Build command from Netlify app:
4:22:47 PM: npm run build
4:22:47 PM: ​
4:22:47 PM: Resolved config
4:22:47 PM: build:
4:22:47 PM: command: npm run build
4:22:47 PM: commandOrigin: ui
4:22:47 PM: environment:
4:22:47 PM: - FONT_AWESOME_KEY
4:22:47 PM: publish: /opt/build/repo/dist
4:22:47 PM: publishOrigin: ui
4:22:47 PM: Caching artifacts
4:22:47 PM: Started saving node modules
4:22:47 PM: Finished saving node modules
4:22:47 PM: Started saving build plugins
4:22:47 PM: Finished saving build plugins
4:22:47 PM: Started saving pip cache
4:22:47 PM: Finished saving pip cache
4:22:47 PM: Started saving emacs cask dependencies
4:22:47 PM: Finished saving emacs cask dependencies
4:22:47 PM: Started saving maven dependencies
4:22:47 PM: Finished saving maven dependencies
4:22:47 PM: Started saving boot dependencies
4:22:47 PM: Finished saving boot dependencies
4:22:47 PM: Started saving rust rustup cache
4:22:47 PM: Finished saving rust rustup cache
4:22:47 PM: Started saving go dependencies
4:22:47 PM: Finished saving go dependencies
4:22:50 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:22:50 PM: Creating deploy upload records
4:22:50 PM: Failing build: Failed to build site
4:22:50 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
4:22:50 PM: Finished processing build request in 38.392962283s

:star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star: :star:
SECOND FAIL

I removed the api key, since that was where it was previously failing.

And now this is the fail log:
Deploy log

4:25:36 PM: Build ready to start
4:25:39 PM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal)
4:25:39 PM: build-image tag: v4.5.3
4:25:39 PM: buildbot version: d0d16b0f5fc4780038932c00d7b03cc901627b5d
4:25:39 PM: Building without cache
4:25:39 PM: Starting to prepare the repo for build
4:25:40 PM: No cached dependencies found. Cloning fresh repo
4:25:40 PM: git clone [git repo name]
4:25:43 PM: Preparing Git Reference refs/heads/main
4:25:43 PM: Parsing package.json dependencies
4:25:44 PM: Starting build script
4:25:45 PM: Installing dependencies
4:25:45 PM: Python version set to 2.7
4:25:45 PM: Downloading and installing node v16.14.0…
4:25:46 PM: Downloading
4:25:46 PM: Computing checksum with sha256sum
4:25:46 PM: Checksums matched!
4:25:50 PM: Now using node v16.14.0 (npm v8.3.1)
4:25:50 PM: Started restoring cached build plugins
4:25:50 PM: Finished restoring cached build plugins
4:25:50 PM: Attempting ruby version 2.7.2, read from environment
4:25:52 PM: Using ruby version 2.7.2
4:25:52 PM: Using PHP version 8.0
4:25:52 PM: Started restoring cached node modules
4:25:52 PM: Finished restoring cached node modules
4:25:53 PM: Installing NPM modules using NPM version 8.3.1
4:25:54 PM: npm WARN old lockfile
4:25:54 PM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
4:25:54 PM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
4:25:54 PM: npm WARN old lockfile
4:25:54 PM: npm WARN old lockfile This is a one-time fix-up, please be patient…
4:25:54 PM: npm WARN old lockfile
4:26:10 PM: added 211 packages, and audited 212 packages in 16s
4:26:10 PM: 74 packages are looking for funding
4:26:10 PM: run npm fund for details
4:26:10 PM: found 0 vulnerabilities
4:26:10 PM: NPM modules installed
4:26:10 PM: Started restoring cached go cache
4:26:10 PM: Finished restoring cached go cache
4:26:10 PM: go version go1.16.5 linux/amd64
4:26:10 PM: go version go1.16.5 linux/amd64
4:26:10 PM: Installing missing commands
4:26:10 PM: Verify run directory
4:26:12 PM: ​
4:26:12 PM: ────────────────────────────────────────────────────────────────
4:26:12 PM: Netlify Build
4:26:12 PM: ────────────────────────────────────────────────────────────────
4:26:12 PM: ​
4:26:12 PM: ❯ Version
4:26:12 PM: @netlify/build 26.3.3
4:26:12 PM: ​
4:26:12 PM: ❯ Flags
4:26:12 PM: baseRelDir: true
4:26:12 PM: buildId: 6214035033fe968ef06a44c9
4:26:12 PM: deployId: 6214035033fe968ef06a44cb
4:26:12 PM: ​
4:26:12 PM: ❯ Current directory
4:26:12 PM: /opt/build/repo
4:26:12 PM: ​
4:26:12 PM: ❯ Config file
4:26:12 PM: No config file was defined: using default values.
4:26:12 PM: ​
4:26:12 PM: ❯ Context
4:26:12 PM: production
4:26:12 PM: ​
4:26:12 PM: ────────────────────────────────────────────────────────────────
4:26:12 PM: 1. Build command from Netlify app
4:26:12 PM: ────────────────────────────────────────────────────────────────
4:26:12 PM: ​
4:26:13 PM: $ npm run build
4:26:13 PM: > monkey@1.0.0 build
4:26:13 PM: > parcel build src/index.html
4:26:14 PM: Building…
4:26:15 PM: Bundling…
4:26:15 PM: Packaging & Optimizing…
4:26:19 PM: :sparkles: Built in 5.50s
4:26:19 PM: dist/index.html 3.76 KB 2.83s
4:26:19 PM: dist/favicon.ac4740b3.ico 17.07 KB 393ms
4:26:19 PM: dist/skate-figure-an.5300f629.gif :warning: 8.42 MB 2.35s
4:26:19 PM: dist/Moneygirl0001.bbcbd66c.jpg 23.86 KB 427ms
4:26:19 PM: dist/Moneygirl0002.7313d9d5.jpg 30.27 KB 1.90s
4:26:19 PM: dist/Moneygirl0003.33e08ab7.jpg 24.94 KB 427ms
4:26:19 PM: dist/Moneygirl0004.0fb6f2e6.jpg 24.13 KB 1.90s
4:26:19 PM: dist/Moneygirl0005.01dfccf5.jpg 23.89 KB 440ms
4:26:19 PM: dist/Moneygirl0006.786f6af3.jpg 25.31 KB 1.90s
4:26:19 PM: dist/Moneygirl0007.076859bb.jpg 20.29 KB 452ms
4:26:19 PM: dist/Moneygirl0008.f3f2f492.jpg 29.67 KB 1.90s
4:26:19 PM: dist/Moneygirl0009.96372c77.jpg 22.15 KB 453ms
4:26:19 PM: dist/Moneygirl0010.171c5763.jpg 23.69 KB 1.90s
4:26:19 PM: dist/Moneygirl0011.964d2f82.jpg 28.11 KB 453ms
4:26:19 PM: dist/Moneygirl0012.6662d8de.jpg 24.14 KB 1.90s
4:26:19 PM: dist/Moneygirl0013.2cf50b76.jpg 19.06 KB 454ms
4:26:19 PM: dist/Moneygirl0014.ed2d66a9.jpg 22.28 KB 1.90s
4:26:19 PM: dist/index.f3819f6d.js 62.6 KB 3.50s
4:26:19 PM: dist/index.b3dca6dc.css 3.43 KB 3.44s
4:26:19 PM: Segmentation fault
4:26:19 PM: ​
4:26:19 PM: ────────────────────────────────────────────────────────────────
4:26:19 PM: “build.command” failed
4:26:19 PM: ────────────────────────────────────────────────────────────────
4:26:19 PM: ​
4:26:19 PM: Error message
4:26:19 PM: Command failed with exit code 139: npm run build
4:26:19 PM: ​
4:26:19 PM: Error location
4:26:19 PM: In Build command from Netlify app:
4:26:19 PM: npm run build
4:26:19 PM: ​
4:26:19 PM: Resolved config
4:26:19 PM: build:
4:26:19 PM: command: npm run build
4:26:19 PM: commandOrigin: ui
4:26:19 PM: publish: /opt/build/repo/dist
4:26:19 PM: publishOrigin: ui
4:26:19 PM: Caching artifacts
4:26:19 PM: Started saving node modules
4:26:19 PM: Finished saving node modules
4:26:19 PM: Started saving build plugins
4:26:19 PM: Finished saving build plugins
4:26:19 PM: Started saving pip cache
4:26:19 PM: Finished saving pip cache
4:26:19 PM: Started saving emacs cask dependencies
4:26:19 PM: Finished saving emacs cask dependencies
4:26:19 PM: Started saving maven dependencies
4:26:20 PM: Finished saving maven dependencies
4:26:20 PM: Started saving boot dependencies
4:26:20 PM: Finished saving boot dependencies
4:26:20 PM: Started saving rust rustup cache
4:26:20 PM: Finished saving rust rustup cache
4:26:20 PM: Started saving go dependencies
4:26:20 PM: Finished saving go dependencies
4:26:22 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:26:22 PM: Creating deploy upload records
4:26:22 PM: Failing build: Failed to build site
4:26:22 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
4:26:22 PM: Finished processing build request in 43.18255827s

Yes, for some reason netlify-cli was not installing unless I used sudo. Then, when it started installing, it gave an error for a dependency. The error said “you do not have permission to install” or something. That was the same error that the npm instal -g netlify-cli had given. I used ‘sudo’ to over-ride that, but couldn’t use it for the dependency. This is all a bit over my head; which is why I am trying to find out if Netlify will give this kind of support if you have a paid account.

This is likely an issue with parcelJS. Found found an open issue that seems related

If you are installing netlify-cli globallly using sudo (i.e. $ sudo npm i -g netlify-cli) then all dependencies should get installed that same way (from my experience.)

On macOS I don’t install using sudo, rather run npm i -g netlify-cli, but when I spin up a Ubuntu VM using Multipass, I need to use sudo npm i -g netlify-cli (to avoid having to modify system configuration to enable running without sudo.)

I don’t believe this is the sort of help Netlify offers even on paid subscriptions.

REGARDING PARCEL BUILD
I looked at that thread to the gitHub error and saw someone suggest this:
“build”: “rm -rf dist/ && PARCEL_WORKERS=0 parcel build src/index.html --no-source-maps --log-level verbose”

I used it and it worked. (fingers crossed). I’m so bad at configuration stuff. Makes my brain hurt. Thanks for the help!

REGARDING CLI INSTALL

Do you happen to know where someone would get help with this sort of thing/ the permissions on the computer. Mac not allowing admin to instal the cli globally, etc

This is a general computer issue, nothing related to Netlify, or Netlify CLI (I don’t believe.) If there is a specific issue with Netlify CLI, then posting an issue on the GitHub repository is a good place to start.

If you have a general computer use issue, other forums such as the Apple Community or Ask Different are good places to start.

1 Like

Okay. Thanks for all the help!

1 Like