gradle-nodejs-plugin
gradle-nodejs-plugin copied to clipboard
NODE_ENV
It would be great if it was possible to set the NODE_ENV variable with this plugin. I tried like this but did not work:
task installNPM(type: NodeJsTask) {
require = ["npm"]
executable = "npm"
args = ['NODE_ENV=production', 'install', '--no-save']
}
I tried out another task that did not work:
task runSetup(type: NodeJsTask) {
require = ["node"]
executable = "node"
args = ['NODE_ENV=production']
}
task installNPM(type: NodeJsTask, dependsOn: [runSetup]) {
require = ["npm"]
executable = "npm"
args = ['install', '--no-save']
}
Gives an error:
Execution failed for task:
> Process 'command '/opt/.nodejs/10.15.0/bin/npm'' finished with non-zero exit value 1