node-gradle / node-gradle/gradle-node-plugin
Wrong npm version is picked up by Intellij IDE
Nobody has claimed this yet.
- Dominant language
- Groovy
- Stars
- 677
- Forks
- 120
- PR merge metrics
- No merged PRs in 30d
Description
I'm working on Gradle project with Intellij IDE and having wrong npm version pickup issue when I try to set npm version outside of node folder in this IDE. (example test-node-plugin.zip)
I have node & npm version specify in build.gradle.
node {
version = '10.16.0'
npmVersion = '6.10.0'
}
So there will be 2 dedicated folders for nodejs & npm are generated inside .gradle folder, after I run npmSetup task. (see next screenshot)
By default IDE will pick both nodejs & npm version in nodejs folder (npm version is 6.9.0)

When I try to pick new version from outside folder (version 6.10.0 in .gradle folder) it still keeping version from nodejs folder, which is 6.9.0.

Do you have any suggestion on this? Would it make sense to update npm version in nodejs folder, let say I will do npm install npm@6.10.0 -g and don't need to refer to npm(outside) folder? IDEA team already close this issue as won't fix because they expect IDE has same behavior as terminal
https://youtrack.jetbrains.com/issue/WEB-40017#focus=streamItem-27-3584381.0-0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the build.gradle node configuration and the npmSetup task described in the issue. Reproduce the setup with npmVersion 6.10.0, then inspect how the generated .gradle npm folder relates to IntelliJ's selected npm path. Done means the configured npm version is consistently picked up outside the nodejs folder, with the behavior verified in the example project.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, nodejs
- Domain
- build-system, developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100