npmInstall up-to-date check broken with fastNpmInstall
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- kotlin, nodejs
- Domain
- build-system, tooling
Research direction
Start in src/main/kotlin/com/github/gradle/node/npm/task/NpmInstallTask.kt around line 115 and inspect how fastNpmInstall determines its outputs. Reproduce the npmInstall, clean, and npmInstall sequence, then verify that removing node_modules makes the task out of date and restores the directory on execution.
Written by the indexing model from the issue text.
Description
I stumbled on a weird issue with the following steps:
- Fresh git checkout, i.e. no
node_modulesdirectory present - Run task
npmInstallwith thefastNpmInstalloption enabled - Run the clean task, i.e. remove the whole
node_modulesdirectory - Run
npmInstallagain, it reports as up-to-date - Other tasks fail because
node_modulesis missing
The problem is that in step 2 the file node_modules/.package-lock.json was not recorded as output because it did not yet exist at configuration time, only after task execution. So the task has no configured outputs and won't become out of date by removing the node_modules directory.
Proposed fix: When using fastNpmInstall, do not check for existance of the file at configuration time here, instead always return the file.
- Dominant language
- Groovy
- Stars
- 677
- Forks
- 120
- PR merge metrics
- No merged PRs in 30d
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.
More from node-gradle/gradle-node-plugin
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
node-gradle/gradle-node-plugin#349 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
node-gradle/gradle-node-plugin#348 · 1 comment ·
-
Corepack & Gradle 9 Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
node-gradle/gradle-node-plugin#351 · 6 comments · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
node-gradle/gradle-node-plugin#350 · 6 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
node-gradle/gradle-node-plugin#347 · 1 comment ·
All issues in node-gradle/gradle-node-plugin
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
agentic-workflows cascade-suspected
Difficulty 1/5 Under an hour Newbie friendliness 88/100