Netlify deployment time out

Hi

I’m trying to deploy a simple landing page to Netlify, but I’m confused with the deployment process. The site I’m trying to deploy has an identical file structure as this one: GitHub - adamlaz/temp-Ava. It’s got a src folder with the javascript and css files and an index.html file in the root of the project. If I run the build command locally, it creates a dist folder with the deployment files. Neither the node_modulesand dist folders are tracked by git. The contents of the package.json file are pretty much identical with the same file in the repo I linked above (temp-Ava/package-sample.json at master · adamlaz/temp-Ava · GitHub).

When I deploy the site to Netlify, I set the base directory as ., the build command as npm run build and the publish directory as ./dist. I’ve got the site linked to my git repo and whenever I push a new commit to it the deployment scheme begins. After running for ~10 minutes, I get an error saying Build exceeded maximum allowed runtime. The full error log can be seen below. There’s also another error saying that Error: Cannot find module 'brace-expansion'.

What am I doing wrong here? My best guess is that I’m not designating the root directory correctly. Another guess is that the Netlify server does not have access to the node modules and thus is not running npm install at any part of the process?

My instance name is: 1. [condescending-dijkstra-ea72ad](https://app.netlify.com/sites/condescending-dijkstra-ea72ad)

Notifications

Here’s the error log:

10:57:05 AM: Build ready to start
10:57:08 AM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
10:57:08 AM: build-image tag: v3.3.5
10:57:08 AM: buildbot version: 036f37945d6de439a17a554b3ae02e2f8f0f1fb0
10:57:08 AM: Fetching cached dependencies
10:57:08 AM: Failed to fetch cache, continuing with build
10:57:08 AM: Starting to prepare the repo for build
10:57:09 AM: No cached dependencies found. Cloning fresh repo
10:57:09 AM: git clone https://github.com/my-profile/my-landing-page
10:57:09 AM: Preparing Git Reference refs/heads/master
10:57:10 AM: Starting build script
10:57:10 AM: Installing dependencies
10:57:11 AM: Downloading and installing node v10.18.1...
10:57:11 AM: Downloading https://nodejs.org/dist/v10.18.1/node-v10.18.1-linux-x64.tar.xz...
10:57:12 AM: 
########################################
10:57:12 AM:                    56.9%
10:57:12 AM: 
########################################################
10:57:12 AM: ################ 100.0%
10:57:12 AM: Computing checksum with sha256sum
10:57:12 AM: Checksums matched!
10:57:14 AM: Now using node v10.18.1 (npm v6.13.4)
10:57:15 AM: Attempting ruby version 2.6.2, read from environment
10:57:16 AM: Using ruby version 2.6.2
10:57:16 AM: Using PHP version 5.6
10:57:16 AM: Started restoring cached node modules
10:57:16 AM: Finished restoring cached node modules
10:57:16 AM: Installing NPM modules using NPM version 6.13.4
10:57:24 AM: npm
10:57:24 AM:  WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
10:57:25 AM: npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
10:57:41 AM: > node-sass@4.13.1 install /opt/build/repo/node_modules/node-sass
10:57:41 AM: > node scripts/install.js
10:57:41 AM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/linux-x64-64_binding.node
10:57:42 AM: Download complete
10:57:42 AM: Binary saved to /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
10:57:42 AM: Caching binary to /opt/buildhome/.npm/node-sass/4.13.1/linux-x64-64_binding.node
10:57:42 AM: > gifsicle@3.0.4 postinstall /opt/build/repo/node_modules/gifsicle
10:57:42 AM: > node lib/install.js
10:57:43 AM:   ✔ gifsicle pre-build test passed successfully
10:57:43 AM: > jpegtran-bin@3.2.0 postinstall /opt/build/repo/node_modules/jpegtran-bin
10:57:43 AM: > node lib/install.js
10:57:44 AM:   ✔ jpegtran pre-build test passed successfully
10:57:44 AM: > optipng-bin@3.1.4 postinstall /opt/build/repo/node_modules/optipng-bin
10:57:44 AM: > node lib/install.js
10:57:44 AM:   ✔ optipng pre-build test passed successfully
10:57:44 AM: > node-sass@4.13.1 postinstall /opt/build/repo/node_modules/node-sass
10:57:44 AM: > node scripts/build.js
10:57:44 AM: Binary found at /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
10:57:44 AM: Testing binary
10:57:44 AM: Binary is fine
10:57:45 AM: > ellie@1.0.0 postinstall /opt/build/repo
10:57:45 AM: > run-s build watch
10:57:45 AM: > ellie@1.0.0 build /opt/build/repo
10:57:45 AM: > run-s build:*
10:57:46 AM: > ellie@1.0.0 build:css /opt/build/repo
10:57:46 AM: > run-s lint-scss scss autoprefixer
10:57:46 AM: > ellie@1.0.0 lint-scss /opt/build/repo
10:57:46 AM: > stylelint src/scss/*.scss --syntax scss || true
10:57:47 AM: > ellie@1.0.0 scss /opt/build/repo
10:57:47 AM: > node-sass --output-style compressed -o dist/css src/scss
10:57:47 AM: Rendering Complete, saving .css file...
10:57:47 AM: Wrote CSS to /opt/build/repo/dist/css/style.css
10:57:47 AM: Wrote 1 CSS files to /opt/build/repo/dist/css
10:57:48 AM: > ellie@1.0.0 autoprefixer /opt/build/repo
10:57:48 AM: > postcss -u autoprefixer -r dist/css/*
10:57:49 AM: > ellie@1.0.0 build:js /opt/build/repo
10:57:49 AM: > run-s lint uglify
10:57:49 AM: > ellie@1.0.0 lint /opt/build/repo
10:57:49 AM: > eslint src/js || true
10:57:51 AM: > ellie@1.0.0 uglify /opt/build/repo
10:57:51 AM: > mkdirp dist/js -p && uglifyjs src/js/*.js -m -c -o dist/js/main.min.js
10:57:52 AM: > ellie@1.0.0 build:images /opt/build/repo
10:57:52 AM: > run-s imagemin
10:57:52 AM: > ellie@1.0.0 imagemin /opt/build/repo
10:57:52 AM: > imagemin src/images/* -o dist/images
10:57:52 AM: 0 images minified
10:57:53 AM: > ellie@1.0.0 watch /opt/build/repo
10:57:53 AM: > run-p serve watch:*
10:57:54 AM: > ellie@1.0.0 watch:css /opt/build/repo
10:57:54 AM: > onchange "src/scss" -- run-s build:css
10:57:54 AM: > ellie@1.0.0 serve /opt/build/repo
10:57:54 AM: > browser-sync start --server --files "dist/css/*.css, dist/js/*.js, **/*.html, !node_modules/**/*.html"
10:57:54 AM: > ellie@1.0.0 watch:images /opt/build/repo
10:57:54 AM: > onchange "src/images" -- run-s build:images
10:57:54 AM: > ellie@1.0.0 watch:js /opt/build/repo
10:57:54 AM: > onchange "src/js" -- run-s build:js
10:57:55 AM: [Browsersync] Access URLs:
10:57:55 AM:  -------------------------------------
10:57:55 AM:        Local: http://localhost:3000
10:57:55 AM:     External: http://x.x.x.x:3000
10:57:55 AM:  -------------------------------------
10:57:55 AM:           UI: http://localhost:3001
10:57:55 AM:  UI External: http://localhost:3001
10:57:55 AM:  -------------------------------------
10:57:55 AM: [Browsersync] Serving files from: ./
10:57:55 AM: [Browsersync] Watching files...
10:57:55 AM: [Browsersync] Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)
11:27:05 AM: Build exceeded maximum allowed runtime
11:27:06 AM: internal/modules/cjs/loader.js:638
11:27:06 AM:     throw err;
11:27:06 AM:     ^
11:27:06 AM: Error: Cannot find module 'brace-expansion'
11:27:06 AM:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
11:27:06 AM:     at Function.Module._load (internal/modules/cjs/loader.js:562:25)
11:27:06 AM:     at Module.require (internal/modules/cjs/loader.js:692:17)
11:27:06 AM:     at require (internal/modules/cjs/helpers.js:25:18)
11:27:06 AM:     at Object.<anonymous> (/opt/build/repo/node_modules/minimatch/minimatch.js:10:14)
11:27:06 AM:     at Module._compile (internal/modules/cjs/loader.js:778:30)
11:27:06 AM:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
11:27:06 AM:     at Module.load (internal/modules/cjs/loader.js:653:32)
11:27:06 AM:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
11:27:06 AM:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
11:27:06 AM: internal/modules/cjs/loader.js:638
11:27:06 AM:     throw err;
11:27:06 AM:     ^
11:27:06 AM: Error: Cannot find module 'brace-expansion'
11:27:06 AM:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
11:27:06 AM:     at Function.Module._load (internal/modules/cjs/loader.js:562:25)
11:27:06 AM:     at Module.require (internal/modules/cjs/loader.js:692:17)
11:27:06 AM:     at require (internal/modules/cjs/helpers.js:25:18)
11:27:06 AM:     at Object.<anonymous> (/opt/build/repo/node_modules/minimatch/minimatch.js:10:14)
11:27:06 AM:     at Module._compile (internal/modules/cjs/loader.js:778:30)
11:27:06 AM:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
11:27:06 AM:     at Module.load (internal/modules/cjs/loader.js:653:32)
11:27:06 AM:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
11:27:06 AM:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)

Almost certainly neither of the things you think are the problem. You’ve started a server process:

10:57:55 AM: [Browsersync] Access URLs:
10:57:55 AM:  -------------------------------------
10:57:55 AM:        Local: http://localhost:3000
10:57:55 AM:     External: http://x.x.x.x:3000
10:57:55 AM:  -------------------------------------
10:57:55 AM:           UI: http://localhost:3001
10:57:55 AM:  UI External: http://localhost:3001
10:57:55 AM:  -------------------------------------
10:57:55 AM: [Browsersync] Serving files from: ./
10:57:55 AM: [Browsersync] Watching files...

which we allow to run until we cut you off at 30 minutes. You can’t run servers here - only build static files, which we’ll serve from our CDN :slight_smile:

Thank you for the answer! You’re right. I think the issue here then is that when I run npm install it automatically starts off the server. I’ll need to look into this and stop it.