# Fix "npm warn deprecated gulp-util: gulp-util is deprecated" in a Gulp Build

Yes. An agent reads the gulpfile, finds what gulp-util is used for, replaces or removes it, runs the gulp tasks to show the build is unchanged and opens a PR.

[Run this on Rush](https://cloud.getrush.ai/run/fix-gulp-util-is-deprecated-warning/gulp/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent clones the repository into its own cloud sandbox and runs `npm install` first, because the warning is printed there, not by gulp. In a browser library like LeaVerou/bliss, a lightweight DOM helper at 1.0.6, the install prints `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` among the other deprecation lines (`babel-eslint@8.2.6`, `chokidar@2.1.8`, `mkdirp@0.5.1`, `core-js@2.6.12`). `package.json` lists `"gulp": "^4.0.2"` with `gulp-concat`, `gulp-rename`, `gulp-uglify` and `"gulp-util": "^3.0.7"` as devDependencies, and its only script is `"test": "karma start --single-run"`; the README's Build section says `npm install` then `gulp`, and `.travis.yml` installs gulp globally and runs it before `npm test`.

Then it reads `gulpfile.js` to see which of gulp-util's pieces are in use. Line 3 is `var gutil = require("gulp-util");` and that is the only mention: the `concat` task joins `bliss.shy.js` and `bliss._.js` into `bliss.js`, the `minify` task runs `gulp-uglify` over `bliss.shy.js` and `bliss.js` with its own `error` handler written with `console.error`, `watch` reruns both through `gulp.series`, and `default` is `gulp.series("concat", "minify")`. Nothing calls `gutil.log`, `gutil.colors`, `gutil.PluginError` or `gutil.env`, so there is nothing to replace with `fancy-log`, `ansi-colors` or `plugin-error`; the require is a leftover.

The fix is to delete line 3 and the devDependency. The agent then runs `npx gulp` before and after: both runs start `default`, finish `concat` and `minify`, and leave the committed `bliss.js`, `bliss.min.js` and `bliss.shy.min.js` byte-for-byte as they were, which `git status` confirms. A fresh `npm install` no longer prints the gulp-util line, and the lockfile loses gulp-util's own tree.

It reports what else the run showed without fixing it. On Node 22, gulp 4.0.2's `vinyl-fs` prints `[DEP0180] DeprecationWarning: fs.Stats constructor is deprecated` during `concat`, which gulp 5 resolves, and the other deprecated packages in the install log belong to karma, eslint and babel-eslint, each a separate upgrade. Those go in the pull request as findings with the package and version, so this change stays the one-line removal it is.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Remove the deprecated gulp-util package from this build. Run npm install and quote the deprecation line it prints for gulp-util. Read the gulpfile and every file that requires gulp-util, and list each gulp-util member in use (log, colors, PluginError, env, replaceExtension, or none). Replace each member with its standalone package as the gulp maintainers recommend, or delete the require when nothing uses it, and remove gulp-util from package.json. Run the gulp default task before and after the change and show the built files are unchanged, then run npm install again to show the warning is gone. Report any other deprecation the install prints with its package and version, without fixing it. Open a pull request that quotes both gulp runs.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

What comes back is a pull request touching `gulpfile.js` and `package.json`, two deleted lines, plus the lockfile entries that go with them. The description quotes the `npm warn deprecated gulp-util@3.0.8` line, states that the gulpfile used none of gulp-util's members, and shows both `gulp` runs finishing `concat` and `minify` with the three built files unchanged.

A reviewer checks that the gulpfile really had no `gutil.` call, that the built files in the diff are untouched, and that the findings list keeps the gulp 5 bump and the karma and babel-eslint deprecations as separate work. The run's record has the install log and both gulp runs, so the warning's disappearance can be read rather than taken on trust.

## Run it on every Monday morning

Add an automation to the repository's Project with this prompt and a `schedule` trigger, `cron` set to `0 9 * * 1` in your `timezone`. Each Monday one run installs, reads the install log and opens a pull request only when a deprecated build package is still in `package.json`; a week with nothing deprecated opens nothing, and a week where a member of gulp-util is in use gets the standalone replacement instead of a plain removal.

The same body works from your own server with `POST /o/{org}/sessions` and an API key after a CI job starts printing a new deprecation; the key's `webhook_url` receives `run.completed` with the session URL and the pull request when the run ends.

## Why run it on Rush?

A deprecation printed by `npm install` is easy to ignore until the package is pulled, and finding out whether anything uses it means reading the gulpfile. The agent reads it in its own sandbox, runs the real build on both sides of the change and keeps every command with its output in the run's record, so the pull request proves the build is unchanged instead of promising it.

Running the build also separates this warning from the others in the same log. Because the agent sees the `fs.Stats` deprecation and the karma-era packages in the same run, it can name them as their own changes rather than folding a gulp 5 upgrade into a two-line removal.

## Frequently asked questions

### What if my gulpfile actually uses gutil.log or gutil.PluginError?

Then the agent swaps each member for the package the gulp maintainers split it into: `fancy-log` for `gutil.log`, `ansi-colors` for `gutil.colors`, `plugin-error` for `gutil.PluginError`, `vinyl` for `gutil.File`, and `minimist` for `gutil.env`. Each one is a one-for-one replacement listed in the pull request with its line, and the build run after the change shows the tasks still finish.

### Will it upgrade gulp 4 to gulp 5 as well?

No. The gulp 5 bump changes the `src` encoding defaults and is its own change; the agent names the `fs.Stats` deprecation it causes on Node 22 as a finding and leaves it out of this pull request. Removing gulp-util works the same on gulp 4 and gulp 5.

### How does it show the build output is the same?

It runs the default task before and after the change in a clean clone and checks `git status`. The built files are committed in this repository, so an unchanged tree after `gulp` means `concat` and `minify` produced the same bytes.

### Why not just silence npm's deprecation warnings?

The warning is the package's own signal that it will not get fixes, including security ones. Removing a leftover require costs two lines; silencing the log hides every future deprecation too.

## More Gulp jobs

- [Fix "ReferenceError: primordials is not defined" by Upgrading gulp 3](https://getrush.ai/run/fix-primordials-is-not-defined/gulp/)
- [Replace Gulp With npm Scripts and a Plain Node Build Script](https://getrush.ai/run/migrate-gulp-to-npm-scripts/gulp/)
- [Fix "AssertionError: Task function must be specified" After Upgrading to gulp 4](https://getrush.ai/run/fix-gulp-task-function-must-be-specified/gulp/)

## More jobs like this: Upgrade dependencies weekly

- [Fix "ImportError: cannot import name 'contextfilter' from 'jinja2'"](https://getrush.ai/run/fix-jinja2-contextfilter-import-error/jinja2/)
- [Fix "line" is not a registered controller When Upgrading Chart.js](https://getrush.ai/run/fix-line-is-not-a-registered-controller/chart-js/)
- [Fix "ImportError: load_boston has been removed from scikit-learn since version 1.2"](https://getrush.ai/run/fix-load-boston-import-error/scikit-learn/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
