Failed first build

Dear community,

I have tried to deploy my first netlify site but get the following build error:

10:12:25 PM: Build ready to start
10:12:27 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
10:12:27 PM: build-image tag: v3.4.1
10:12:27 PM: buildbot version: 648208d76731cd5bca75c1e9bc99d2032a1f1473
10:12:27 PM: Fetching cached dependencies
10:12:27 PM: Failed to fetch cache, continuing with build
10:12:27 PM: Starting to prepare the repo for build
10:12:28 PM: No cached dependencies found. Cloning fresh repo
10:12:28 PM: git clone https://github.com/LimpingTwerp/allemannia
10:12:34 PM: Preparing Git Reference refs/heads/master
10:12:37 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: ‘’ versus ‘./’ in the Netlify UI
10:12:37 PM: Starting build script
10:12:37 PM: Installing dependencies
10:12:37 PM: Python version set to 2.7
10:12:38 PM: v12.18.0 is already installed.
10:12:39 PM: Now using node v12.18.0 (npm v6.14.4)
10:12:39 PM: Started restoring cached build plugins
10:12:39 PM: Finished restoring cached build plugins
10:12:39 PM: Attempting ruby version 2.7.1, read from environment
10:12:41 PM: Using ruby version 2.7.1
10:12:41 PM: Using PHP version 5.6
10:12:41 PM: 5.2 is already installed.
10:12:41 PM: Using Swift version 5.2
10:12:41 PM: Started restoring cached node modules
10:12:42 PM: Finished restoring cached node modules
10:12:42 PM: Installing NPM modules using NPM version 6.14.4
10:13:04 PM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/core-js
10:13:04 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
10:13:05 PM: > core-js@3.6.5 postinstall /opt/build/repo/node_modules/vue-slick-carousel/node_modules/core-js
10:13:05 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
10:13:05 PM: > uglifyjs-webpack-plugin@0.4.6 postinstall /opt/build/repo/node_modules/uglifyjs-webpack-plugin
10:13:05 PM: > node lib/post_install.js
10:13:06 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
10:13:06 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
10:13:06 PM: added 1158 packages from 605 contributors and audited 1229 packages in 23.214s
10:13:07 PM: 27 packages are looking for funding
10:13:07 PM: run npm fund for details
10:13:07 PM: found 228 vulnerabilities (216 low, 5 moderate, 7 high)
10:13:07 PM: run npm audit fix to fix them, or npm audit for details
10:13:07 PM: NPM modules installed
10:13:07 PM: Started restoring cached go cache
10:13:07 PM: Finished restoring cached go cache
10:13:07 PM: go version go1.14.4 linux/amd64
10:13:07 PM: go version go1.14.4 linux/amd64
10:13:07 PM: Installing missing commands
10:13:07 PM: Verify run directory
10:13:09 PM: ​
10:13:09 PM: ┌─────────────────────────────┐
10:13:09 PM: │ Netlify Build │
10:13:09 PM: └─────────────────────────────┘
10:13:09 PM: ​
10:13:09 PM: ❯ Version
10:13:09 PM: @netlify/build 4.0.4
10:13:09 PM: ​
10:13:09 PM: ❯ Flags
10:13:09 PM: deployId: 5f6bac2938acbf302936a795
10:13:09 PM: mode: buildbot
10:13:09 PM: ​
10:13:09 PM: ❯ Current directory
10:13:09 PM: /opt/build/repo
10:13:09 PM: ​
10:13:09 PM: ❯ Config file
10:13:09 PM: No config file was defined: using default values.
10:13:09 PM: ​
10:13:09 PM: ❯ Context
10:13:09 PM: production
10:13:09 PM: ​
10:13:09 PM: ┌───────────────────────────────────┐
10:13:09 PM: │ 1. Build command from Netlify app │
10:13:09 PM: └───────────────────────────────────┘
10:13:09 PM: ​
10:13:09 PM: $ npm run build
10:13:09 PM: > allemannia@1.0.0 build /opt/build/repo
10:13:09 PM: > cross-env NODE_ENV=production webpack --progress --hide-modules
10:13:10 PM: 0% compiling
10:13:10 PM: 10% building modules 0/1 modules 1 active …/index.js!/opt/build/repo/src/main.js
10:13:10 PM: 10% building modules 1/1 modules 0 active
10:13:10 PM: 10% building modules 1/2 modules 1 active …repo/node_modules/vue/dist/vue.esm.js
10:13:10 PM: 10% building modules 2/2 modules 0 active
10:13:10 PM: 10% building modules 2/3 modules 1 active …s??ref–1!/opt/build/repo/src/App.vue
10:13:10 PM: 10% building modules 2/4 modules 2 active …ode_modules/timers-browserify/main.js
10:13:10 PM: 10% building modules 3/4 modules 1 active …ode_modules/timers-browserify/main.js
10:13:10 PM: 10% building modules 3/5 modules 2 active …uild/repo/src/assets/css/tailwind.css
10:13:10 PM: 10% building modules 4/5 modules 1 active …ode_modules/timers-browserify/main.js
10:13:10 PM: 10% building modules 4/6 modules 2 active …ode_modules/webpack/buildin/global.js
10:13:11 PM: 10% building modules 4/7 modules 3 active …uild/repo/src/assets/css/tailwind.css
10:13:11 PM: 10% building modules 5/7 modules 2 active …uild/repo/src/assets/css/tailwind.css
10:13:11 PM: 10% building modules 5/8 modules 3 active …e-style-loader/lib/addStylesClient.js
10:13:11 PM: 10% building modules 6/8 modules 2 active …e-style-loader/lib/addStylesClient.js
10:13:11 PM: 10% building modules 7/8 modules 1 active …e-style-loader/lib/addStylesClient.js
10:13:11 PM: 10% building modules 7/9 modules 2 active …t&index=0!/opt/build/repo/src/App.vue
10:13:11 PM: 10% building modules 8/9 modules 1 active …e-style-loader/lib/addStylesClient.js
10:13:11 PM: 10% building modules 8/10 modules 2 active …uild/repo/src/assets/css/tailwind.css
10:13:11 PM: 11% building modules 9/10 modules 1 active …e-style-loader/lib/addStylesClient.js
10:13:11 PM: 11% building modules 9/11 modules 2 active …e&index=0!/opt/build/repo/src/App.vue
10:13:11 PM: 11% building modules 10/11 modules 1 active …e-style-loader/lib/addStylesClient.js
10:13:11 PM: 11% building modules 10/12 modules 2 active …uild/repo/src/assets/css/tailwind.css
10:13:11 PM: 11% building modules 10/13 modules 3 active …ue-loader/lib/component-normalizer.js
10:13:11 PM: 11% building modules 11/13 modules 2 active …ue-loader/lib/component-normalizer.js
10:13:11 PM: 11% building modules 11/14 modules 3 active …de_modules/css-loader/lib/css-base.js
10:13:11 PM: 11% building modules 12/14 modules 2 active …de_modules/css-loader/lib/css-base.js
10:13:11 PM: 11% building modules 13/14 modules 1 active …uild/repo/src/assets/css/tailwind.css
10:13:11 PM: 11% building modules 13/15 modules 2 active …/vue-style-loader/lib/listToStyles.js
10:13:11 PM: 11% building modules 13/16 modules 3 active …t/build/repo/src/components/Entry.vue
10:13:11 PM: 11% building modules 13/17 modules 4 active …ild/repo/src/components/HeaderNav.vue
10:13:11 PM: 11% building modules 13/18 modules 5 active …/build/repo/src/components/Slider.vue
10:13:11 PM: 11% building modules 13/19 modules 6 active …ld/repo/src/components/SliderCard.vue
10:13:11 PM: 11% building modules 13/20 modules 7 active …ld/repo/src/components/ImagePlace.vue
10:13:11 PM: 11% building modules 13/21 modules 8 active …/repo/src/components/ProgramMonth.vue
10:13:11 PM: 11% building modules 14/21 modules 7 active …/repo/src/components/ProgramMonth.vue
10:13:11 PM: 11% building modules 15/21 modules 6 active …/repo/src/components/ProgramMonth.vue
10:13:11 PM: 11% building modules 16/21 modules 5 active …/repo/src/components/ProgramMonth.vue
10:13:11 PM: 12% building modules 17/21 modules 4 active …/repo/src/components/ProgramMonth.vue
10:13:11 PM: 12% building modules 18/21 modules 3 active …/repo/src/components/ProgramMonth.vue
10:13:11 PM: 12% building modules 19/21 modules 2 active …/repo/src/components/ProgramMonth.vue
10:13:11 PM: 12% building modules 20/21 modules 1 active …uild/repo/src/assets/css/tailwind.css
10:13:11 PM: 12% building modules 20/22 modules 2 active …_modules/setimmediate/setImmediate.js
10:13:11 PM: 12% building modules 20/23 modules 3 active …t/build/repo/src/components/Entry.vue
10:13:11 PM: 12% building modules 20/24 modules 4 active …t/build/repo/src/components/Entry.vue
10:13:11 PM: 12% building modules 21/24 modules 3 active …t/build/repo/src/components/Entry.vue
10:13:11 PM: 12% building modules 22/24 modules 2 active …_modules/setimmediate/setImmediate.js
10:13:11 PM: 12% building modules 22/25 modules 3 active …/build/repo/src/components/Slider.vue
10:13:11 PM: 12% building modules 22/26 modules 4 active …/build/repo/src/components/Slider.vue
10:13:11 PM: 12% building modules 23/26 modules 3 active …/build/repo/src/components/Slider.vue
10:13:11 PM: 12% building modules 24/26 modules 2 active …_modules/setimmediate/setImmediate.js
10:13:11 PM: 12% building modules 24/27 modules 3 active …ild/repo/src/components/HeaderNav.vue
10:13:11 PM: 12% building modules 24/28 modules 4 active …ild/repo/src/components/HeaderNav.vue
10:13:11 PM: 13% building modules 25/28 modules 3 active …ild/repo/src/components/HeaderNav.vue
10:13:11 PM: 13% building modules 26/28 modules 2 active …_modules/setimmediate/setImmediate.js
10:13:11 PM: 13% building modules 26/29 modules 3 active …ld/repo/src/components/SliderCard.vue
10:13:11 PM: 13% building modules 26/30 modules 4 active …ld/repo/src/components/SliderCard.vue
10:13:11 PM: 13% building modules 27/30 modules 3 active …ld/repo/src/components/SliderCard.vue
10:13:11 PM: 13% building modules 28/30 modules 2 active …_modules/setimmediate/setImmediate.js
10:13:11 PM: 13% building modules 28/31 modules 3 active …ld/repo/src/components/ImagePlace.vue
10:13:11 PM: 13% building modules 28/32 modules 4 active …ld/repo/src/components/ImagePlace.vue
10:13:11 PM: 13% building modules 29/32 modules 3 active …ld/repo/src/components/ImagePlace.vue
10:13:11 PM: 13% building modules 30/32 modules 2 active …_modules/setimmediate/setImmediate.js
10:13:11 PM: 13% building modules 30/33 modules 3 active …/repo/src/components/ProgramMonth.vue
10:13:11 PM: 13% building modules 30/34 modules 4 active …/repo/src/components/ProgramMonth.vue
10:13:11 PM: 13% building modules 31/34 modules 3 active …/repo/src/components/ProgramMonth.vue
10:13:21 PM: 13% building modules 32/34 modules 2 active …_modules/setimmediate/setImmediate.js
10:13:21 PM: 13% building modules 33/34 modules 1 active …_modules/setimmediate/setImmediate.js
10:13:21 PM: 14% building modules 34/34 modules 0 active
10:13:21 PM: 14% building modules 34/35 modules 1 active …-carousel/dist/vue-slick-carousel.css
10:13:21 PM: 14% building modules 35/35 modules 0 active
10:13:21 PM: 14% building modules 35/36 modules 1 active …-carousel/dist/vue-slick-carousel.css
10:13:21 PM: 14% building modules 35/37 modules 2 active …sel/dist/vue-slick-carousel-theme.css
10:13:21 PM: 14% building modules 36/37 modules 1 active …-carousel/dist/vue-slick-carousel.css
10:13:21 PM: 14% building modules 36/38 modules 2 active …sel/dist/vue-slick-carousel-theme.css
10:13:21 PM: 14% building modules 36/39 modules 3 active …uild/repo/src/components/Dropdown.vue
10:13:22 PM: 14% building modules 36/40 modules 4 active …/repo/src/components/HeaderButton.vue
10:13:22 PM: 14% building modules 37/40 modules 3 active …/repo/src/components/HeaderButton.vue
10:13:22 PM: 14% building modules 38/40 modules 2 active …/repo/src/components/HeaderButton.vue
10:13:22 PM: 14% building modules 38/41 modules 3 active …/repo/node_modules/process/browser.js
10:13:22 PM: 14% building modules 39/41 modules 2 active …/repo/node_modules/process/browser.js
10:13:22 PM: 14% building modules 40/41 modules 1 active …/repo/node_modules/process/browser.js
10:13:22 PM: 14% building modules 40/42 modules 2 active …uild/repo/src/components/Dropdown.vue
10:13:22 PM: 14% building modules 40/43 modules 3 active …uild/repo/src/components/Dropdown.vue
10:13:22 PM: 14% building modules 41/43 modules 2 active …uild/repo/src/components/Dropdown.vue
10:13:22 PM: 15% building modules 42/43 modules 1 active …/repo/node_modules/process/browser.js
10:13:22 PM: 15% building modules 42/44 modules 2 active …/repo/src/components/HeaderButton.vue
10:13:22 PM: 15% building modules 43/44 modules 1 active …/repo/node_modules/process/browser.js
10:13:22 PM: 15% building modules 43/45 modules 2 active …/repo/src/components/HeaderButton.vue
10:13:22 PM: 15% building modules 43/46 modules 3 active …/repo/src/components/HeaderButton.vue
10:13:22 PM: 15% building modules 44/46 modules 2 active …/repo/src/components/HeaderButton.vue
10:13:22 PM: 15% building modules 45/46 modules 1 active …/repo/node_modules/process/browser.js
10:13:22 PM: 15% building modules 46/46 modules 0 active
10:13:22 PM: 15% building modules 46/47 modules 1 active …/repo/src/components/HeaderButton.vue
10:13:22 PM: 15% building modules 47/47 modules 0 active
10:13:22 PM: 15% building modules 47/48 modules 1 active …rousel/dist/vue-slick-carousel.umd.js
10:13:22 PM: 15% building modules 47/49 modules 2 active …epo/src/components/OnClickOutside.vue
10:13:22 PM: 15% building modules 47/50 modules 3 active …/build/repo/src/assets/img/Zirkel.svg
10:13:22 PM: 15% building modules 48/50 modules 2 active …/build/repo/src/assets/img/Zirkel.svg
10:13:22 PM: 15% building modules 48/51 modules 3 active …epo/src/components/OnClickOutside.vue
10:13:22 PM: 15% building modules 49/51 modules 2 active …/build/repo/src/assets/img/Zirkel.svg
10:13:22 PM: 16% building modules 50/51 modules 1 active …/build/repo/src/assets/img/Zirkel.svg
10:13:22 PM: 16% building modules 51/51 modules 0 active
10:13:22 PM: 71% sealing
10:13:22 PM: 72% optimizing
10:13:22 PM: 73% basic module optimization
10:13:22 PM: 74% module optimization
10:13:22 PM: 75% advanced module optimization
10:13:22 PM: 76% basic chunk optimization
10:13:22 PM: 77% chunk optimization
10:13:22 PM: 78% advanced chunk optimization
10:13:22 PM: 79% module and chunk tree optimization
10:13:22 PM: 80% chunk modules optimization
10:13:22 PM: 81% advanced chunk modules optimization
10:13:22 PM: 82% module reviving
10:13:22 PM: 83% module order optimization
10:13:22 PM: 84% module id optimization
10:13:22 PM: 85% chunk reviving
10:13:22 PM: 86% chunk order optimization
10:13:22 PM: 87% chunk id optimization
10:13:22 PM: 88% hashing
10:13:22 PM: 89% module assets processing
10:13:22 PM: 90% chunk assets processing
10:13:22 PM: 91% additional chunk assets processing
10:13:22 PM: 92% recording
10:13:23 PM: 91% additional asset processing
10:13:23 PM: 92% chunk asset optimization
10:13:23 PM: 94% asset optimization
10:13:23 PM: 95% emitting
10:13:23 PM: Hash: 1c3ddb27c68b0deeb504
10:13:23 PM: Version: webpack 3.12.0
10:13:23 PM: Time: 14003ms
10:13:23 PM: Asset Size Chunks Chunk Names
10:13:23 PM: Zirkel.svg?db632aa28615334b4e8c473d7d185b05 4.98 kB [emitted]
10:13:23 PM: build.js 1.51 MB 0 [emitted] [big] main
10:13:23 PM: build.js.map 1.94 MB 0 [emitted] main
10:13:23 PM: ERROR in build.js from UglifyJs
10:13:23 PM: Unexpected token: punc (() [src/App.vue:38,0][build.js:560,6]
10:13:24 PM: npm ERR! code ELIFECYCLE
10:13:24 PM: npm ERR! errno 2
10:13:24 PM: npm ERR! allemannia@1.0.0 build: cross-env NODE_ENV=production webpack --progress --hide-modules
10:13:24 PM: npm ERR! Exit status 2
10:13:24 PM: npm ERR!
10:13:24 PM: npm ERR! Failed at the allemannia@1.0.0 build script.
10:13:24 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:13:24 PM: npm ERR! A complete log of this run can be found in:
10:13:24 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-09-23T20_13_24_110Z-debug.log
10:13:24 PM: ​
10:13:24 PM: ┌─────────────────────────────┐
10:13:24 PM: │ “build.command” failed │
10:13:24 PM: └─────────────────────────────┘
10:13:24 PM: ​
10:13:24 PM: Error message
10:13:24 PM: Command failed with exit code 2: npm run build
10:13:24 PM: ​
10:13:24 PM: Error location
10:13:24 PM: In Build command from Netlify app:
10:13:24 PM: npm run build
10:13:24 PM: ​
10:13:24 PM: Resolved config
10:13:24 PM: build:
10:13:24 PM: base: /opt/build/repo
10:13:24 PM: command: npm run build
10:13:24 PM: commandOrigin: ui
10:13:24 PM: publish: /opt/build/repo/dist
10:13:24 PM: Caching artifacts
10:13:24 PM: Started saving node modules
10:13:24 PM: Finished saving node modules
10:13:24 PM: Started saving build plugins
10:13:24 PM: Finished saving build plugins
10:13:24 PM: Started saving pip cache
10:13:24 PM: Finished saving pip cache
10:13:24 PM: Started saving emacs cask dependencies
10:13:24 PM: Finished saving emacs cask dependencies
10:13:24 PM: Started saving maven dependencies
10:13:24 PM: Finished saving maven dependencies
10:13:24 PM: Started saving boot dependencies
10:13:24 PM: Finished saving boot dependencies
10:13:24 PM: Started saving go dependencies
10:13:24 PM: Finished saving go dependencies
10:13:27 PM: Error running command: Build script returned non-zero exit code: 2
10:13:27 PM: Failing build: Failed to build site
10:13:27 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
10:13:27 PM: Finished processing build request in 59.639195772s

Which does not occur when I build the site locally. How would I go about debugging this? (The site is fairly simple)

Hi, @LimpingTwerp. Interesting as it does happen for me locally. It is a public repo so I cloned it, confirmed I was using node v12.18.0 just as shown in the logs, and then ran npm install. After that I ran the build command and got this output:

$ npm run build

> allemannia@1.0.0 build /Users/me/tmp/allemannia
> cross-env NODE_ENV=production webpack --progress --hide-modules

Hash: 1c3ddb27c68b0deeb504
Version: webpack 3.12.0
Time: 7357ms
                                      Asset     Size  Chunks                    Chunk Names
Zirkel.svg?db632aa28615334b4e8c473d7d185b05  4.98 kB          [emitted]
                                   build.js  1.51 MB       0  [emitted]  [big]  main
                               build.js.map  1.94 MB       0  [emitted]         main

ERROR in build.js from UglifyJs
Unexpected token: punc (() [src/App.vue:38,0][build.js:560,6]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! allemannia@1.0.0 build: `cross-env NODE_ENV=production webpack --progress --hide-modules`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the allemannia@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2020-09-24T08_39_22_814Z-debug.log

I was able to reproduce the error outside of Netlify.

It would seem there is some difference with your local system which doesn’t exist when a fresh clone of the repo is done. As this issue isn’t Netlify specific, our support team won’t be able to assist (as our scope of support doesn’t cover troubleshooting custom code).

Finally, just because our support team doesn’t troubleshoot custom code, doesn’t mean someone else won’t. Someone else might have time to troubleshoot this code and this question is still welcome here. I only wanted to be clear about the limits of the technical support our support team provides.

​Please let us know if there are questions about this reply or anything else Netlify related.

Dear luke,

thank you for your analysis, this is indeed an interesting observation. I will try to work on it from that perspective.

All the best
Kai