-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support using node from other project #61
Comments
I guess what you really want is just one instance of node/npm, to which I unfortunately don't have a good answer. |
Ah okay, Thanks for the quick reply! |
This is a feature we probably want to support in the future though, so I'm editing the title and re-opening this issue :-) |
I am able to make this work to an extent. All you really have to do is set the workDir and npmWorkDir to the same directory like this: workDir = file("${rootDir}/nodejs") This fails if you make any attempt to run the build in parallel, however, because it still wants to unpack npm and nodejs every time. I was hoping it would detect that node was already installed and not try to do it a second time, but that is not the case. What I found is that if download=true, it always unpacks it. If download=false, it uses your system copy. |
I guess the easiest way forward would be to add an option to |
Can't you just always install in the rootProject's .gradle directory instead of the sub-project's .gradle directory? |
This idea may be a good solution, but it would be necessary to ensure that there can be no conflict in case of multiple projects of the same multi-project build using different Node.js configurations (for instance different version). Or maybe we should force all projects to use the same Node.js configuration? |
@bsautel Just add distinct installation directories per version ? |
At least with version 3.5 (not sure about the newer ones), it seems that when However, it seem that setting up node in all the projects the sameway (with Note: you can alternatively locate tasks of type com.github.gradle.node.task.NodeSetupTask / com.github.gradle.node.npm.task.NpmSetupTask instead of going by name |
There's two specific ways of working that this plugin supports, one is "always use this specific version of node" ( Disabling But as long as you use the same version of node everywhere thanks to Gradle's dependency mechanism you should only be downloading nodejs once (and if you use a blank npm version you download npm 0 times 🎉) so you'll be saving space from unpacking node but still have the same amount of downloads |
The text was updated successfully, but these errors were encountered: