Home
Support Forums

Eleventy deploy fails with error "could not determine executable to run"

Hello,

I’m running into problems deploying a basic Eleventy site. It worked fine with a cloned tutorial repo but when I start from scratch I can’t get it to work.

The build is failing with the error: “npm ERR! could not determine executable to run”

The Netlify site is: tender-fermat-8d3d11

Here is package.json:

{
  "name": "eleventy-netlify",
  "version": "1.0.0",
  "description": "",
  "main": ".eleventy.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "npx eleventy",
    "serve": "npx eleventy --serve",
    "debug": "DEBUG=* npx eleventy"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/JustinBEverett/eleventy-netlify.git"
  },
  "author": "Justin Everett",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/JustinBEverett/eleventy-netlify/issues"
  },
  "homepage": "https://github.com/JustinBEverett/eleventy-netlify#readme",
  "devDependencies": {
    "eleventy": "^1.0.6"
  }
}

Here is the entire log:

4:05:43 PM: Build ready to start
4:05:45 PM: build-image version: 3bcb38c35508b42e9121d4badfe6d8c66fd7a3f0
4:05:45 PM: build-image tag: v4.3.2
4:05:45 PM: buildbot version: 54316104acdcb2e9f0f577467e93bdd6178d217d
4:05:45 PM: Fetching cached dependencies
4:05:45 PM: Failed to fetch cache, continuing with build
4:05:45 PM: Starting to prepare the repo for build
4:05:45 PM: No cached dependencies found. Cloning fresh repo
4:05:45 PM: git clone https://github.com/JustinBEverett/eleventy-netlify
4:05:46 PM: Preparing Git Reference refs/heads/main
4:05:46 PM: Parsing package.json dependencies
4:05:47 PM: Starting build script
4:05:47 PM: Installing dependencies
4:05:47 PM: Python version set to 2.7
4:05:48 PM: Downloading and installing node v16.12.0...
4:05:48 PM: Downloading https://nodejs.org/dist/v16.12.0/node-v16.12.0-linux-x64.tar.xz...
4:05:48 PM: Computing checksum with sha256sum
4:05:48 PM: Checksums matched!
4:05:51 PM: Now using node v16.12.0 (npm v8.1.0)
4:05:51 PM: Started restoring cached build plugins
4:05:51 PM: Finished restoring cached build plugins
4:05:51 PM: Attempting ruby version 2.7.2, read from environment
4:05:53 PM: Using ruby version 2.7.2
4:05:53 PM: Using PHP version 8.0
4:05:53 PM: Started restoring cached node modules
4:05:53 PM: Finished restoring cached node modules
4:05:53 PM: Installing NPM modules using NPM version 8.1.0
4:05:54 PM: added 1 package, and audited 2 packages in 511ms
4:05:54 PM: found 0 vulnerabilities
4:05:54 PM: NPM modules installed
4:05:55 PM: Started restoring cached go cache
4:05:55 PM: Finished restoring cached go cache
4:05:55 PM: go version go1.16.5 linux/amd64
4:05:55 PM: go version go1.16.5 linux/amd64
4:05:55 PM: Installing missing commands
4:05:55 PM: Verify run directory
4:05:56 PM: ​
4:05:56 PM: ────────────────────────────────────────────────────────────────
4:05:56 PM:   Netlify Build                                                 
4:05:56 PM: ────────────────────────────────────────────────────────────────
4:05:56 PM: ​
4:05:56 PM: ❯ Version
4:05:56 PM:   @netlify/build 18.17.5
4:05:56 PM: ​
4:05:56 PM: ❯ Flags
4:05:56 PM:   baseRelDir: true
4:05:56 PM:   buildId: 6170a0c7cf85030008e6c3ae
4:05:56 PM:   deployId: 6170a0c7cf85030008e6c3b0
4:05:56 PM: ​
4:05:56 PM: ❯ Current directory
4:05:56 PM:   /opt/build/repo
4:05:56 PM: ​
4:05:56 PM: ❯ Config file
4:05:56 PM:   /opt/build/repo/netlify.toml
4:05:56 PM: ​
4:05:56 PM: ❯ Context
4:05:56 PM:   production
4:05:56 PM: ​
4:05:56 PM: ────────────────────────────────────────────────────────────────
4:05:56 PM:   1. build.command from netlify.toml                            
4:05:56 PM: ────────────────────────────────────────────────────────────────
4:05:56 PM: ​
4:05:56 PM: $ npm run build
4:05:57 PM: > eleventy-netlify@1.0.0 build
4:05:57 PM: > npx eleventy
4:05:57 PM: npm ERR! could not determine executable to run
4:05:57 PM: npm ERR! A complete log of this run can be found in:
4:05:57 PM: npm ERR!     /opt/buildhome/.npm/_logs/2021-10-20T23_05_57_566Z-debug.log
4:05:57 PM: ​
4:05:57 PM: ────────────────────────────────────────────────────────────────
4:05:57 PM:   "build.command" failed                                        
4:05:57 PM: ────────────────────────────────────────────────────────────────
4:05:57 PM: ​
4:05:57 PM:   Error message
4:05:57 PM:   Command failed with exit code 1: npm run build
4:05:57 PM: ​
4:05:57 PM:   Error location
4:05:57 PM:   In build.command from netlify.toml:
4:05:57 PM:   npm run build
4:05:57 PM: ​
4:05:57 PM:   Resolved config
4:05:57 PM:   build:
4:05:57 PM:     command: npm run build
4:05:57 PM:     commandOrigin: config
4:05:57 PM:     publish: /opt/build/repo/_site
4:05:57 PM:     publishOrigin: config
4:05:58 PM: Caching artifacts
4:05:58 PM: Started saving node modules
4:05:58 PM: Finished saving node modules
4:05:58 PM: Started saving build plugins
4:05:58 PM: Finished saving build plugins
4:05:58 PM: Started saving pip cache
4:05:58 PM: Finished saving pip cache
4:05:58 PM: Started saving emacs cask dependencies
4:05:58 PM: Finished saving emacs cask dependencies
4:05:58 PM: Started saving maven dependencies
4:05:58 PM: Finished saving maven dependencies
4:05:58 PM: Started saving boot dependencies
4:05:58 PM: Finished saving boot dependencies
4:05:58 PM: Started saving rust rustup cache
4:05:58 PM: Finished saving rust rustup cache
4:05:58 PM: Started saving go dependencies
4:05:58 PM: Finished saving go dependencies
4:06:00 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:06:00 PM: Creating deploy upload records
4:06:00 PM: Failing build: Failed to build site
4:06:00 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
4:06:00 PM: Finished processing build request in 15.673406906s

Hi @justineverett

According to the netlify.toml file in the root of your repository, you are publishing the _site directory. This directory contain an index.html file (which contains not HTML) and nothing else. Therefore you have no need to run a build step (eleventy or otherwise) as there is nothing that requires building.