gradle-node-plugin icon indicating copy to clipboard operation
gradle-node-plugin copied to clipboard

Unable to set max_old_space_size when using NpmTask

Open brian428 opened this issue 8 years ago • 5 comments

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?

brian428 avatar Nov 02 '17 19:11 brian428

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

schepuri2012 avatar Sep 24 '19 16:09 schepuri2012

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.

brian428 avatar Sep 24 '19 18:09 brian428

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.

schepuri2012 avatar Sep 24 '19 19:09 schepuri2012

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

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

thkapasi avatar Feb 05 '20 14:02 thkapasi

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

thiru-rajamoorthy avatar Dec 02 '20 09:12 thiru-rajamoorthy