← Back to issue list

nodejs plugin does not download dependencies from package.json to the correct location

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1652542
Type
issue
State
closed
Author
~jonathon-love
Labels
—
Created
Updated
Closed

Current evaluation

Reported that the nodejs plugin omitted cwd when installing package.json deps. Fixed by snapcore/snapcraft PR #1023, merged to snapcraft as commit d3b476573 ("nodejs plugin: fix the plugin's dependency installation").

Resolution: closed resolved

Reason: The reporter's follow-up PR snapcore/snapcraft#1023 was merged into snapcraft as commit d3b476573, which passes the source directory as npm's working directory when pulling dependencies. The Launchpad bug was closed as Fixed.

Evaluated by: mr-cal-bot

No scores available.

Issue body

hi, as can be seen, the cwd argument has been omitted in this particular call: https://github.com/snapcore/snapcraft/blob/2f0be35542620a251ba1b29a31d2b924029e2a2c/snapcraft/plugins/nodejs.py#L138 i'll submit a PR shortly. jonathon

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Reported that the nodejs plugin omitted cwd when installing package.json deps. Fixed by snapcore/snapcraft PR #1023, merged to snapcraft as commit d3b476573 ("nodejs plugin: fix the plugin's dependency installation").
stealth/space-bunny-alpha — closed resolved Fixed Node.js dependency installation by passing the source directory as npm's working directory; PR snapcore/snapcraft#1023 merged as d3b476573.
stealth/space-bunny-alpha — closed resolved Missing `cwd` in the Node.js plugin's npm install call meant package.json dependencies were installed in the wrong place. Fixed by PR snapcore/snapcraft#1023, merged into master as commit d3b476573 (LP #1652542).
stealth/space-bunny-alpha — closed resolved Missing cwd in the Node.js plugin caused npm dependencies to install in the wrong location. Fixed by merged PR #1023, commit d3b476573.
stealth/space-bunny-alpha — closed resolved Fixed Node.js package dependency installation in snapcraft#800 (commit ced6edd9c), installing package.json devDependencies during the build.
stealth/space-bunny-alpha — closed resolved Dependency installation was corrected by PR #1023, merged as commit d3b476573.
qwen/qwen3.6-35b-a3b — — The nodejs plugin failed to download dependencies to the correct location due to a missing cwd argument. The author submitted a pull request to fix the oversight. The issue is closed, indicating the fix was merged and the bug resolved.
qwen/qwen3.6-35b-a3b — — Fixed via a pull request that added the missing cwd argument to the nodejs plugin, correcting package.json dependency download paths.
qwen/qwen3.6-35b-a3b — — Closed after a pull request was merged to add the missing cwd argument to the nodejs plugin, fixing the dependency download location.
qwen3.6-35b-a3b-mtp-q6 — — Abandoned. The missing cwd argument in the Node.js plugin causing incorrect dependency installation was never addressed via a pull request.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcraft#1023 (confidence 95%)

    PR linked in the issue's only comment; merged as commit d3b476573

  • Related To: snapcraft#996 (confidence 40%)

    Commit 2f0be3554 (#996, get_build_properties refactor) is the code state the bug was reported against

Related issues

Issue Project State Summary Similarity
#1633298 nodejs plugin never runs install during pull snapcraft (launchpad) closed Bug where the nodejs plugin skipped npm install during pull (builddir check always false) was fixed by merged PR snapcore/snapcraft#936 (commit 0497daaac), which installs dependencies during pull.
77%
#1623509 nodejs plugin does not download dependencies from package.json snapcraft (launchpad) closed Fixed in merged PR #800 via commit ced6edd9c: the Node.js plugin now installs package.json devDependencies during the build phase.
76%
#1886858 nodejs plugin doesn't set npm path for custom node version snapcraft (launchpad) open Legacy nodejs builds could miss downloaded npm on PATH; current Snapcraft has replaced nodejs with npm and removed core18 support, leaving this old report obsolete.
73%
#2424 nodejs plugin: fail gracefully when a package.json is missing snapcraft merged Merged in canonical/snapcraft#2424 as 99b7cc984, making the Node.js plugin fail gracefully when package.json is missing; resolves LP #1807971.
73%