Cannot find module './lib/ast-converter' (Error):

netlify site name. cathy-dutton

  • Build problems - pasted below

2:15:19 PM: Build ready to start
2:15:22 PM: build-image version: 3bcb38c35508b42e9121d4badfe6d8c66fd7a3f0
2:15:22 PM: build-image tag: v4.3.2
2:15:22 PM: buildbot version: aee0303dea627c3e97b18430312d321caaaa48e3
2:15:22 PM: Building without cache
2:15:22 PM: Starting to prepare the repo for build
2:15:23 PM: No cached dependencies found. Cloning fresh repo
2:15:23 PM: git clone git@github.com:cathydutton/cathydutton.co.uk
2:15:26 PM: Preparing Git Reference refs/heads/master
2:15:27 PM: Parsing package.json dependencies
2:15:27 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: ‘functions’ versus ‘’ in the Netlify UI
2:15:27 PM: Different build command detected, going to use the one specified in the Netlify configuration file: ‘gulp production --prod’ versus ‘yarn run prod’ in the Netlify UI
2:15:27 PM: Starting build script
2:15:27 PM: Installing dependencies
2:15:27 PM: Python version set to 2.7
2:15:28 PM: Downloading and installing node v8.17.0…
2:15:29 PM: Downloading https://nodejs.org/dist/v8.17.0/node-v8.17.0-linux-x64.tar.xz
2:15:29 PM: Computing checksum with sha256sum
2:15:29 PM: Checksums matched!
2:15:31 PM: Now using node v8.17.0 (npm v6.13.4)
2:15:31 PM: Started restoring cached build plugins
2:15:31 PM: Finished restoring cached build plugins
2:15:32 PM: Attempting ruby version 2.7.2, read from environment
2:15:33 PM: Using ruby version 2.7.2
2:15:34 PM: Using PHP version 8.0
2:15:34 PM: Started restoring cached node modules
2:15:34 PM: Finished restoring cached node modules
2:15:34 PM: Installing NPM modules using NPM version 6.13.4
2:16:18 PM: > phantomjs-prebuilt@2.1.16 install /opt/build/repo/node_modules/phantomjs-prebuilt
2:16:18 PM: > node install.js
2:16:18 PM: PhantomJS not found on PATH
2:16:18 PM: Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
2:16:18 PM: Saving to /opt/buildhome/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
2:16:18 PM: Receiving…
2:16:18 PM: Received 22866K total.
2:16:18 PM: Extracting tar contents (via spawned process)
2:16:22 PM: Removing /opt/build/repo/node_modules/phantomjs-prebuilt/lib/phantom
2:16:22 PM: Copying extracted folder /opt/buildhome/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1635254178853/phantomjs-2.1.1-linux-x86_64 → /opt/build/repo/node_modules/phantomjs-prebuilt/lib/phantom
2:16:23 PM: Writing location.js file
2:16:23 PM: Done. Phantomjs binary available at /opt/build/repo/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
2:16:23 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/core-js
2:16:23 PM: > node -e “try{require(‘./postinstall’)}catch(e){}”
2:16:23 PM: > ejs@2.7.4 postinstall /opt/build/repo/node_modules/ejs
2:16:23 PM: > node ./postinstall.js
2:16:24 PM: > gifsicle@3.0.4 postinstall /opt/build/repo/node_modules/gifsicle
2:16:24 PM: > node lib/install.js
2:16:25 PM: :heavy_check_mark: gifsicle pre-build test passed successfully
2:16:25 PM: > jpegtran-bin@3.2.0 postinstall /opt/build/repo/node_modules/jpegtran-bin
2:16:25 PM: > node lib/install.js
2:16:25 PM: :heavy_check_mark: jpegtran pre-build test passed successfully
2:16:25 PM: > optipng-bin@3.1.4 postinstall /opt/build/repo/node_modules/optipng-bin
2:16:25 PM: > node lib/install.js
2:16:26 PM: :heavy_check_mark: optipng pre-build test passed successfully
2:16:29 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
2:16:29 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
2:16:29 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/browser-sync/node_modules/fsevents):
2:16:29 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
2:16:29 PM: added 1928 packages from 1695 contributors and audited 1936 packages in 53.576s
2:16:31 PM: 82 packages are looking for funding
2:16:31 PM: run npm fund for details
2:16:31 PM: found 74 vulnerabilities (3 low, 42 moderate, 24 high, 5 critical)
2:16:31 PM: run npm audit fix to fix them, or npm audit for details
2:16:31 PM: NPM modules installed
2:16:31 PM: Started restoring cached go cache
2:16:31 PM: Finished restoring cached go cache
2:16:31 PM: Installing Go version 1.10
2:16:36 PM: unset GOOS;
2:16:36 PM: unset GOARCH;
2:16:36 PM: export GOROOT=‘/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64’;
2:16:36 PM: export PATH=“/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}”;
2:16:36 PM: go version >&2;
2:16:36 PM: export GIMME_ENV=“/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env”
2:16:36 PM: go version go1.10 linux/amd64
2:16:36 PM: Installing missing commands
2:16:36 PM: Verify run directory
2:16:37 PM: ​
2:16:37 PM: ────────────────────────────────────────────────────────────────
2:16:37 PM: Netlify Build
2:16:37 PM: ────────────────────────────────────────────────────────────────
2:16:37 PM: ​
2:16:37 PM: ❯ Version
2:16:37 PM: @netlify/build 18.18.0
2:16:37 PM: ​
2:16:37 PM: ❯ Flags
2:16:37 PM: baseRelDir: false
2:16:37 PM: buildId: 6177ff672d841141458eef51
2:16:37 PM: deployId: 6177ff672d841141458eef53
2:16:37 PM: ​
2:16:37 PM: ❯ Current directory
2:16:37 PM: /opt/build/repo
2:16:37 PM: ​
2:16:37 PM: ❯ Config file
2:16:37 PM: /opt/build/repo/netlify.toml
2:16:37 PM: ​
2:16:37 PM: ❯ Context
2:16:37 PM: production
2:16:37 PM: ​
2:16:37 PM: ────────────────────────────────────────────────────────────────
2:16:37 PM: 1. build.command from netlify.toml
2:16:37 PM: ────────────────────────────────────────────────────────────────
2:16:37 PM: ​
2:16:37 PM: $ gulp production --prod
2:16:40 PM: [13:16:40] Using gulpfile /opt/build/repo/gulpfile.js
2:16:40 PM: [13:16:40] Starting ‘production’…
2:16:40 PM: [13:16:40] Starting ‘test’…
2:16:40 PM: [13:16:40] Starting ‘cssLint’…
2:16:40 PM: [13:16:40] Starting ‘a11y’…
2:16:40 PM: [13:16:40] Starting ‘jsTest’…
2:16:40 PM: [13:16:40] Starting ‘jsLint’…
2:16:40 PM: [13:16:40] Finished ‘a11y’ after 34 ms
2:16:40 PM: [13:16:40] Finished ‘jsTest’ after 85 ms
2:16:40 PM: [13:16:40] Finished ‘jsLint’ after 86 ms
2:16:40 PM: Browserslist: caniuse-lite is outdated. Please run:
2:16:40 PM: npx browserslist@latest --update-db
2:16:40 PM: Why you should do it regularly:
2:16:40 PM: GitHub - browserslist/browserslist: 🦔 Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-preset-env
2:16:40 PM: [13:16:40] gulp-postcss: 1-settings/fonts.css
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/1-settings/fonts.css:46:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: [13:16:40] gulp-postcss: 5-base/typography.css
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/5-base/typography.css:49:1: Unexpected duplicate selector “h2”, first used at line 35 (no-duplicate-selectors)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/5-base/typography.css:93:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: [13:16:40] gulp-postcss: 6-components/buttons.css
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:67:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:68:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:69:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:70:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:71:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:72:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:73:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:74:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:75:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:76:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:77:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/buttons.css:78:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: [13:16:40] gulp-postcss: 6-components/cards.css
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/cards.css:68:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: [13:16:40] gulp-postcss: 6-components/pagination.css
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/pagination.css:85:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/pagination.css:86:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: [13:16:40] gulp-postcss: 6-components/profile.css
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/profile.css:71:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/profile.css:72:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/profile.css:73:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: [13:16:40] gulp-postcss: 6-components/range-input.css
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/range-input.css:17:3: Unexpected duplicate selector “.slider”, first used at line 13 (no-duplicate-selectors)
2:16:40 PM: [13:16:40] gulp-postcss: 6-components/webmentions.css
2:16:40 PM: stylelint: /opt/build/repo/src/site/_includes/css/6-components/webmentions.css:90:1: Expected no more than 2 empty lines (max-empty-lines)
2:16:40 PM: [13:16:40] Finished ‘cssLint’ after 403 ms
2:16:40 PM: [13:16:40] Finished ‘test’ after 404 ms
2:16:40 PM: [13:16:40] Starting ‘build’…
2:16:40 PM: [13:16:40] Starting ‘generate’…
2:16:40 PM: [13:16:40] ‘generate’ errored after 17 ms
2:16:40 PM: [13:16:40] TypeError: runCommands(…).then(…).catch(…).finally is not a function
2:16:40 PM: at DestroyableTransform._transform (/opt/build/repo/node_modules/gulp-shell/lib/index.js:87:21)
2:16:40 PM: at DestroyableTransform.Transform._read (/opt/build/repo/node_modules/readable-stream/lib/_stream_transform.js:184:10)
2:16:40 PM: at DestroyableTransform.Transform._write (/opt/build/repo/node_modules/readable-stream/lib/_stream_transform.js:172:83)
2:16:40 PM: at doWrite (/opt/build/repo/node_modules/readable-stream/lib/_stream_writable.js:428:64)
2:16:40 PM: at writeOrBuffer (/opt/build/repo/node_modules/readable-stream/lib/_stream_writable.js:417:5)
2:16:40 PM: at DestroyableTransform.Writable.write (/opt/build/repo/node_modules/readable-stream/lib/_stream_writable.js:334:11)
2:16:40 PM: at DestroyableTransform.ondata (/opt/build/repo/node_modules/readable-stream/lib/_stream_readable.js:619:20)
2:16:40 PM: at emitOne (events.js:116:13)
2:16:40 PM: at DestroyableTransform.emit (events.js:211:7)
2:16:40 PM: at addChunk (/opt/build/repo/node_modules/readable-stream/lib/_stream_readable.js:291:12)
2:16:40 PM: at readableAddChunk (/opt/build/repo/node_modules/readable-stream/lib/_stream_readable.js:278:11)
2:16:40 PM: at DestroyableTransform.Readable.push (/opt/build/repo/node_modules/readable-stream/lib/_stream_readable.js:245:10)
2:16:40 PM: at DestroyableTransform.Transform.push (/opt/build/repo/node_modules/readable-stream/lib/_stream_transform.js:148:32)
2:16:40 PM: at Pumpify.onReadable (/opt/build/repo/node_modules/to-through/index.js:25:14)
2:16:40 PM: at emitNone (events.js:106:13)
2:16:40 PM: at Pumpify.emit (events.js:208:7)
2:16:40 PM: [13:16:40] ‘build’ errored after 19 ms
2:16:40 PM: [13:16:40] ‘production’ errored after 425 ms
2:16:40 PM: ​
2:16:40 PM: ────────────────────────────────────────────────────────────────
2:16:40 PM: “build.command” failed
2:16:40 PM: ────────────────────────────────────────────────────────────────
2:16:40 PM: ​
2:16:40 PM: Error message
2:16:40 PM: Command failed with exit code 1: gulp production --prod
2:16:40 PM: ​
2:16:40 PM: Error location
2:16:40 PM: In build.command from netlify.toml:
2:16:40 PM: gulp production --prod
2:16:40 PM: ​
2:16:40 PM: Resolved config
2:16:40 PM: build:
2:16:40 PM: command: gulp production --prod
2:16:40 PM: commandOrigin: config
2:16:40 PM: environment:
2:16:40 PM: - WEBMENTION_IO_TOKEN
2:16:40 PM: publish: /opt/build/repo/dist
2:16:40 PM: publishOrigin: config
2:16:40 PM: functionsDirectory: /opt/build/repo/functions
2:16:41 PM: Caching artifacts
2:16:41 PM: Started saving node modules
2:16:41 PM: Finished saving node modules
2:16:41 PM: Started saving build plugins
2:16:41 PM: Finished saving build plugins
2:16:41 PM: Started saving pip cache
2:16:41 PM: Finished saving pip cache
2:16:41 PM: Started saving emacs cask dependencies
2:16:41 PM: Finished saving emacs cask dependencies
2:16:41 PM: Started saving maven dependencies
2:16:41 PM: Finished saving maven dependencies
2:16:41 PM: Started saving boot dependencies
2:16:41 PM: Finished saving boot dependencies
2:16:41 PM: Started saving rust rustup cache
2:16:41 PM: Finished saving rust rustup cache
2:16:41 PM: Started saving go dependencies
2:16:41 PM: Eleventy fatal error: (more in DEBUG output)
2:16:41 PM: > Cannot find module ‘./lib/ast-converter’ (Error):
2:16:41 PM: Error: Cannot find module ‘./lib/ast-converter’
2:16:41 PM: at Function.Module._resolveFilename (module.js:548:15)
2:16:41 PM: at Function.Module._load (module.js:475:25)
2:16:41 PM: at Module.require (module.js:597:17)
2:16:41 PM: at require (internal/module.js:11:18)
2:16:41 PM: at Object. (/opt/build/repo/node_modules/typescript-eslint-parser/parser.js:13:15)
2:16:41 PM: at Module._compile (module.js:653:30)
2:16:41 PM: at Object.Module._extensions…js (module.js:664:10)
2:16:41 PM: at Module.load (module.js:566:32)
2:16:41 PM: at tryModuleLoad (module.js:506:12)
2:16:41 PM: at Function.Module._load (module.js:498:3)
2:16:42 PM: Finished saving go dependencies
2:16:46 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:16:46 PM: Creating deploy upload records
2:16:46 PM: Failing build: Failed to build site
2:16:46 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
2:16:46 PM: Finished processing build request in 1m24.007784055s

The better the post - the faster the answer.

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem. Have you worked through this already?

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your project repo, etc. Thanks!

I am wondering why you are using node v8 @cdutton, and if changing the version to v14 might remedy this issue.