Skip to content

Feature request: Add ability to extend PATH environment variable for the npm process #1381

Closed
@yevhensayenko

Description

@yevhensayenko

I would like to use local nodeJS, that is downloaded into project dir using https://github.com/node-gradle/gradle-node-plugin. I tried to specify npm executable using using prettier().npmExecutable('<path to project>/.gradle/nodejs/node-v16.18.0-linux-x64/bin/npm'). But it still expects node command to be present. So the only way to set it up for me was to override PATH using command line like PATH=/<path to project>/.gradle/nodejs/node-v16.18.0-linux-x64/bin:$PATH ./gradlew.

But it seems that we could do it by overriding PATH variable using java.lang.ProcessBuilder#environment() in com.diffplug.spotless.npm.NpmProcess#npm. So, I think it would be helpful to be able to set up node bin directory in settings, so it can be then added into PATH environment variable for the process.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions