Skip to content
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

npmInstall running when not needed #324

Open
slatin-esteco opened this issue Oct 11, 2024 · 2 comments
Open

npmInstall running when not needed #324

slatin-esteco opened this issue Oct 11, 2024 · 2 comments
Labels
question Further information is requested

Comments

@slatin-esteco
Copy link

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:
image
One of the incriminated tasks
image
The relative script in package.json:
image

The node that I install doesn't have pnpm but I don't think it is the real problem

@deepy
Copy link
Member

deepy commented Oct 14, 2024

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

@deepy deepy added the question Further information is requested label Oct 14, 2024
@slatin-esteco
Copy link
Author

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:
image
But the old method that invoked automatically the npm scripts was easier to use for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants