Closed slatin-esteco closed 1 month ago
Does changing from npm_run_build
to pnpm_run_build
work?
The <foo>_run_
rules add a dependency to their install
equivalent (i.e. npm_run_foo
depends on npmInstall
and pnpm_run_foo
depends on pnpmInstall
)
I'm not familiar with how nx
works, but if it handles the pnpm install
already you might want to register your own PnpmTask
that's configured the same as your task above
https://github.com/node-gradle/gradle-node-plugin/blob/main/docs/usage.md#executing-npm-commands-via-npx has some examples
unfortunatly pnpm_run
doesn't exist if I am correct (I tried and searched online). To resolve the problem I am changing every task I have by registering tasks with the PnpmTask
set like this:
But the old method that invoked automatically the npm scripts was easier to use for me
Having tested it on a clean copy of 7.1.0
the pnpm_
rules behave just like the npm_
rules so a search and replace should work
And if you don't need the dependency on pnpmInstall
use the pnpm_
rule rather than the pnpm_run_
one
But regardless, I'd still recommend defining the task like you've done above, it's the same amount of lines and only 27 characters more than relying on the rule
I have in the build.gradle a NpmTask that launch automatically a script in the package.json. My problem is that I am changing npm to pnpm and the plugin when it detects changes in the package.json launch npmInstall but It mustn't do this. Is there a way to override the npmInstall with pnpmInstall, block the npmInstall or set node to absolutely not use npm but use pnpm?
Node settings: One of the incriminated tasks The relative script in package.json:
The node that I install doesn't have pnpm but I don't think it is the real problem