Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku build fails because npm is missing

I am using terser as a minification step in a gradle task. But heroku does not have the npm binary during the build.

This is what i tried

val installTerser = tasks.create<Exec>("installTerser") {
    commandLine("npm", "install", "-g", "terser")
}

Is there a way to install a executable into the repository, so i can use it without the need for npm in heroku ?

Or how can i tell heroku that i need both java and nodejs tools ?

like image 559
Nikky Avatar asked Dec 02 '25 23:12

Nikky


1 Answers

Add the Node.js buildpack to your app by running:

$ heroku buildpacks:add -i 1 heroku/nodejs 

Then redeploy.

like image 114
codefinger Avatar answered Dec 04 '25 15:12

codefinger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!