← Back to issue list

node plugin: run build in pull phase to download dependencies.

View original Github issue

Metadata

Project
snapcraft
Number
#762
Type
pull request
State
merged
Author
smoser
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #762 as commit 0b3283081, moving npm dependency downloads to pull and enabling offline builds with --cache-min=Infinity.

Resolution: closed resolved

Reason: The merged change installs npm dependencies during the pull phase and caches them with --cache-min=Infinity, allowing the subsequent build to avoid registry access.

Evaluated by: mr-cal-bot

No scores available.

Issue body

This runs the build in the pull phase to download all needed dependencies. There is no way to 'npm install --download-only'. Additionally, we add the --cache-min=Infinity which is required. Without it, the run in the build phase will try to reach the npm registry. Lastly, instead of '-g', use the more self-documenting long form '--global'.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #762 as commit 0b3283081, moving npm dependency downloads to pull and enabling offline builds with --cache-min=Infinity.
stealth/space-bunny-alpha — closed resolved Merged in snapcraft#762 (commit 0b3283081): node plugin now runs npm install during pull to fetch deps, adds --cache-min=Infinity for offline build, and uses --global instead of -g.
stealth/space-bunny-alpha — closed resolved Merged in #762 (0b3283081): the node plugin now downloads npm dependencies during pull, uses --cache-min=Infinity for offline builds, and replaces -g with --global.
qwen/qwen3.6-35b-a3b — — Merged. Relocates npm dependency installation to the pull phase and adds --cache-min=Infinity to enable offline builds. Replaces -g with --global. Verified offline functionality and approved.
qwen3.6-35b-a3b-mtp-q6 — — Merged. The node plugin now executes npm install during the pull phase with --cache-min=Infinity to fetch dependencies upfront, ensuring offline builds. Code was adjusted per reviewer feedback before approval.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft (launchpad)#1612005 (confidence 98%)

    Launchpad bug #1612005 reported npm downloads during build and was fixed by PR #762.

Related issues

Issue Project State Summary Similarity
#361 plugins: implement strict/offline plugins craft-parts merged Merged strict/offline plugin support in PR #361 via commit 1a9a48bd, separating dependency pulls from build execution and adding tests.
73%
#810 nodejs plugin: Add mechanism to run “npm run” commands. snapcraft merged Merged PR #810 in commit a83d75e13, adding Node.js plugin support for npm-run build commands; follow-up #936 enabled dependency installation during pull.
71%