Alternative solutions

This is not the only solution, and you might also want to look at:

Alex Nordlun’s Node plugin

It enables the use of a number of technologies related to node, including npm, yarn and pnpm. It bootstraps node as well.

Craig Burke’s Client Dependencies plugin

Install client side dependencies from npm or bower by declaring dependencies in build.gradle.

Cronn Pnpm plugin

A Gradle plugin that provisions pnpm and integrates a pnpm workspace into a Gradle build. It seems to have a focus on where a pnpm-driven monorepo is the layout of the repository, and some Gradle is added into the root of the repo alongside the pnpm root layout.

Jef Stano’s NPM plugin

Generic npm/node build lifecycle support for use within MSP.

Moowork’s Node plugin

Gradle plugin for executing node scripts (supports npm, yarn, grunt and gulp).

Palantir NPM plugin

A Gradle Plugin to create lifecycle tasks that trigger npm run commands.

Takuya Kuwahara’s Yarn plugin

Allows any yarn commands to be run in a Gradle build script. It has not been maintained in a long time and will probably not work with any Gradle 7+.