srs / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
864 stars 212 forks source link

Unable to set max_old_space_size when using NpmTask #267

Open brian428 opened 7 years ago

brian428 commented 7 years ago

In reference to #180, I think we need a similar mechanism to pass Node arguments to an NpmTask. I believe that right now the only option is write a custom subclass of NpmTask to accomplish this, which obviously isn't ideal. Thoughts?

schepuri2012 commented 5 years ago

I have the exact same requirement, is there a way to set the max_old_space_size argument to an NpmTask?

brian428 commented 5 years ago

The only option I've found is to set the NODE_OPTIONS environment variable (either before Gradle runs or as a permanent OS env. variable). E.g. export NODE_OPTIONS=--max_old_space_size=8192.

schepuri2012 commented 5 years ago

Ok, I tried setting the NODE_OPTIONS environment variable in the JenkinsFile as a step before the gradle build is kicked in, but still running into Gradle daemon disappearance error.

thkapasi commented 4 years ago

https://stackoverflow.com/a/60077606/9591122

workaround by setting env vars by writing them into the gradle wrapper script files

thiru-rajamoorthy commented 3 years ago

Hello Friends,

I'm getting the memory allocation issue during the gulp process using "NodeJS" plugin on jenkins alone, The same works fine when i do the gulp manually.

image