Getting "gulp not found" when deploying (after connecting different repository)

Hello,

My Netlify project was running smoothly, today i transferred my repository to a different GitLab group/account. I then in Netlify connected the different repository. That worked fine, but when i did a build, i got an error that it couldn’t find gulp. I’ve been googling for an hour now and not finding anything. My node and npm versions seem fine. Any help would be appreciated! Thanks in advance!

sh: 1: gulp: not found

Locally when i run npm run gulp it works fine. But not on a Netlify build.

My sitename: mc-ui-components

Build settings:

image

My build output:

2:00:14 PM: Waiting for other deploys from your team to complete. Check the queue: https://app.netlify.com/teams/mr-chadd/builds
2:01:10 PM: build-image version: 4c0c1cadee6a31c9bb8d824514030009c4c05c6a (focal)
2:01:10 PM: build-image tag: v4.15.0
2:01:10 PM: buildbot version: cc0c986a947e274d444f48f63f797a5d01f2a89a
2:01:10 PM: Fetching cached dependencies
2:01:10 PM: Failed to fetch cache, continuing with build
2:01:10 PM: Starting to prepare the repo for build
2:01:11 PM: No cached dependencies found. Cloning fresh repo
2:01:11 PM: git clone git@gitlab.com:mr-chadd/front-end/mc-ui-components
2:01:23 PM: Preparing Git Reference refs/heads/main
2:01:24 PM: Parsing package.json dependencies
2:01:25 PM: Section completed: initializing
2:01:26 PM: Starting build script
2:01:26 PM: Installing dependencies
2:01:26 PM: Python version set to 2.7
2:01:26 PM: v16.18.1 is already installed.
2:01:26 PM: Now using node v16.18.1 (npm v8.19.2)
2:01:26 PM: Enabling node corepack
2:01:26 PM: Started restoring cached build plugins
2:01:26 PM: Finished restoring cached build plugins
2:01:27 PM: Attempting ruby version 2.7.2, read from environment
2:01:27 PM: Using ruby version 2.7.2
2:01:27 PM: Using PHP version 8.0
2:01:27 PM: No npm workspaces detected
2:01:27 PM: Started restoring cached node modules
2:01:27 PM: Finished restoring cached node modules
2:01:28 PM: Installing NPM modules using NPM version 8.19.2
2:01:41 PM: added 1519 packages, and audited 1520 packages in 14s
2:01:41 PM: 8 packages are looking for funding
2:01:41 PM:   run `npm fund` for details
2:01:41 PM: 53 vulnerabilities (1 low, 9 moderate, 32 high, 11 critical)
2:01:41 PM: To address issues that do not require attention, run:
2:01:41 PM:   npm audit fix
2:01:41 PM: To address all issues (including breaking changes), run:
2:01:41 PM:   npm audit fix --force
2:01:41 PM: Run `npm audit` for details.
2:01:42 PM: NPM modules installed
2:01:42 PM: Creating package sha
2:01:42 PM: Started restoring cached go cache
2:01:42 PM: Finished restoring cached go cache
2:01:43 PM: Installing Go version 1.19.4 (requested 1.19.x)
2:01:47 PM: unset GOOS;
2:01:47 PM: unset GOARCH;
2:01:47 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.19.4.linux.amd64';
2:01:47 PM: export PATH="/opt/buildhome/.gimme/versions/go1.19.4.linux.amd64/bin:${PATH}";
2:01:47 PM: go version >&2;
2:01:47 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.19.4.linux.amd64.env"
2:01:47 PM: go version go1.19.4 linux/amd64
2:01:48 PM: Detected 2 framework(s)
2:01:48 PM: "vue" at version "4.5.8"
2:01:48 PM: "gulp" at version "4.0.2"
2:01:48 PM: Installing missing commands
2:01:48 PM: Verify run directory
2:01:49 PM: ​
2:01:49 PM: ────────────────────────────────────────────────────────────────
2:01:49 PM:   Netlify Build                                                 
2:01:49 PM: ────────────────────────────────────────────────────────────────
2:01:49 PM: ​
2:01:49 PM: ❯ Version
2:01:49 PM:   @netlify/build 29.0.1
2:01:49 PM: ​
2:01:49 PM: ❯ Flags
2:01:49 PM:   baseRelDir: true
2:01:49 PM:   buildId: 63908e5e69bf6200082ec529
2:01:49 PM:   deployId: 63908e5e69bf6200082ec52b
2:01:49 PM: ​
2:01:49 PM: ❯ Current directory
2:01:49 PM:   /opt/build/repo
2:01:49 PM: ​
2:01:49 PM: ❯ Config file
2:01:49 PM:   No config file was defined: using default values.
2:01:49 PM: ​
2:01:49 PM: ❯ Context
2:01:49 PM:   production
2:01:49 PM: ​
2:01:49 PM: ────────────────────────────────────────────────────────────────
2:01:49 PM:   1. Build command from Netlify app                             
2:01:49 PM: ────────────────────────────────────────────────────────────────
2:01:49 PM: ​
2:01:49 PM: $ npm run gulp && npm run build
2:01:49 PM: > mc-ui-components@1.0.0 gulp
2:01:49 PM: > gulp clean; gulp all
2:01:49 PM: sh: 1: gulp: not found
2:01:49 PM: sh: 1: gulp: not found
2:01:49 PM: ​
2:01:49 PM: ────────────────────────────────────────────────────────────────
2:01:49 PM:   "build.command" failed                                        
2:01:49 PM: ────────────────────────────────────────────────────────────────
2:01:49 PM: ​
2:01:49 PM:   Error message
2:01:49 PM:   Command failed with exit code 127: npm run gulp && npm run build (https://ntl.fyi/exit-code-127)
2:01:49 PM: ​
2:01:49 PM:   Error location
2:01:49 PM:   In Build command from Netlify app:
2:01:49 PM:   npm run gulp && npm run build
2:01:49 PM: ​
2:01:49 PM:   Resolved config
2:01:49 PM:   build:
2:01:49 PM:     command: npm run gulp && npm run build
2:01:49 PM:     commandOrigin: ui
2:01:49 PM:     publish: /opt/build/repo/dist
2:01:49 PM:     publishOrigin: ui
2:01:50 PM: Caching artifacts
2:01:50 PM: Started saving node modules
2:01:50 PM: Finished saving node modules
2:01:50 PM: Started saving build plugins
2:01:50 PM: Finished saving build plugins
2:01:50 PM: Started saving pip cache
2:01:50 PM: Finished saving pip cache
2:01:50 PM: Started saving emacs cask dependencies
2:01:50 PM: Finished saving emacs cask dependencies
2:01:50 PM: Started saving maven dependencies
2:01:50 PM: Finished saving maven dependencies
2:01:50 PM: Started saving boot dependencies
2:01:50 PM: Finished saving boot dependencies
2:01:50 PM: Started saving rust rustup cache
2:01:50 PM: Finished saving rust rustup cache
2:01:50 PM: Started saving go dependencies
2:01:52 PM: Creating deploy upload records
2:01:50 PM: Finished saving go dependencies
2:01:52 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:01:52 PM: Failing build: Failed to build site
2:01:52 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
2:01:52 PM: Finished processing build request in 41.777063689s

My package.json: (as you can see, gulp is in my devDependencies list)

{
    "name": "mc-ui-components",
    "version": "1.0.0",
    "private": true,
    "scripts": {
        "serve": "vue-cli-service serve",
        "build": "vue-cli-service build",
        "lint": "vue-cli-service lint",
        "test": "echo \"no test specified\"",
        "gulp": "gulp clean; gulp all"
    },
    "main": "none",
    "dependencies": {},
    "devDependencies": {
        "core-js": "^3.6.5",
        "cropperjs": "^1.5.11",
        "vue": "^3.2.25",
        "vue-router": "^4.0.0-0",
        "vuex": "^4.0.0-0",
        "@vue/cli-plugin-babel": "~4.5.0",
        "@vue/cli-plugin-eslint": "~4.5.0",
        "@vue/cli-plugin-router": "~4.5.0",
        "@vue/cli-plugin-vuex": "~4.5.0",
        "@vue/cli-service": "~4.5.0",
        "@vue/compiler-sfc": "^3.0.0",
        "@vue/eslint-config-prettier": "^6.0.0",
        "babel-eslint": "^10.1.0",
        "del": "^6.0.0",
        "eslint": "^6.7.2",
        "eslint-plugin-prettier": "^3.1.3",
        "eslint-plugin-vue": "^7.0.0-0",
        "gulp": "^4.0.2",
        "gulp-concat": "^2.6.1",
        "gulp-dart-sass": "^1.0.2",
        "gulp-sass-glob": "^1.1.0",
        "pinia": "^2.0.23",
        "prettier": "^1.19.1",
        "sass": "^1.26.5",
        "sass-loader": "^8.0.2"
    },
    "license": "ISC",
    "readme": "ERROR: No README data found!",
}

Does moving it to dependencies help?

The solution was to downgrade the NPM version, so we added this to our netlify.toml

[build.environment]
  NPM_VERSION = "6.14.4"

Hiya @chadd :wave:t6: , welcome to the forums! :netliconfetti: I’m glad to have you here. Sorry to hear you were having issues with your deploy. Thank you for marking the solution and coming back to let us know what helped you! We appreciate the feedback as this will help other users who experience other issues with their build.