Open hosswald opened 6 months ago
Ditto for yarn workspaces. I need to tell gradle-node-plugin to use a subfolder for package.json and root for the lock file.
I just changed my module setup and now I am encountering this.
When running a NpxTask
in CI I get:
npm error could not determine executable to run
It seems, it is because I have the relevant dependency defined in the parent module.
We have a monorepo with multiple workspaces. The workspaces also reflect the gradle (sub)project structure. Our project structure looks like this:
The root
package.json
definedscripts/
as a workspace:We apply the gradle-node-plugin in the
scripts/build.gradle
like this:The problem is that
npmInstall
only registers changes to the rootpackage.json
etc., but not toscripts/package.json
etc. So if I change a dependency inscripts/package.json
,npmInstall
might not run. It would be nice if thenpmInstall
task could check for changes inpackage.json
etc. in all workspaces defined in the rootpackage.json
as well. Currently, we need this workaround:I don't think the problem is related to our unusual project structure, but likely affects every situation where NPM workspaces are involved - NpmInstallTask just doesn't seem to consider changes to workspace files / npm files outside of
nodeProjectDir
at all.