← Back to issue list

npm-run does not respect source-subdir

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1694642
Type
issue
State
open
Author
~saviq
Labels
sources
Created
Updated
Closed
—

Current evaluation

Legacy nodejs plugin bug: npm-run ignored source-subdir. The rejected 2017 PR targeted a plugin and option later removed from Snapcraft.

Suggested action: close stale

Reason: The report provides an exact reproducer and links PR snapcore/snapcraft#1342, but a maintainer later confirmed that PR had been rejected and asked whether work would continue. Current migration documentation replaces nodejs with npm, while commit ffb164b7a removed snapcraft_legacy and the current npm plugin has no npm-run option. Because the affected legacy plugin and option are no longer present and the reporter did not revive the work, the issue is obsolete rather than fixed.

Evaluated by: mr-cal-bot

Impact: 22 Quick Win: 3 Complexity: 25 Confidence: 94 Actionability: 20

Issue body

Given a part: my-part: # See 'snapcraft plugins' plugin: nodejs npm-run: [foo] source: . source-subdir: nodeapp And a tree: . ├── nodeapp │   └── package.json └── snap └── snapcraft.yaml npm tries to find package.json in the root: npm run foo npm ERR! Linux 4.10.0-21-generic npm ERR! argv "/tmp/nodejs-snap/parts/my-part/install/bin/node" "/tmp/nodejs-snap/parts/my-part/install/bin/npm" "run" "foo" npm ERR! node v6.10.2 npm ERR! npm v3.10.10 npm ERR! path /tmp/nodejs-snap/parts/my-part/src/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open '/tmp/nodejs-snap/parts/my-part/src/package.json' npm ERR! enoent ENOENT: no such file or directory, open '/tmp/nodejs-snap/parts/my-part/src/package.json' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! Please include the following file with any support request: npm ERR! /tmp/nodejs-snap/parts/my-part/src/npm-debug.log Command '['/bin/sh', '/tmp/tmpri054knq', 'npm', 'run', 'foo']' returned non-zero exit status 254.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 22
Quick Win: 3
Complexity: 25
Confidence: 94
Actionability: 20
close stale Legacy nodejs plugin bug: npm-run ignored source-subdir. The rejected 2017 PR targeted a plugin and option later removed from Snapcraft.
stealth/space-bunny-alpha
Impact: 35
Quick Win: 20
Complexity: 35
Confidence: 87
Actionability: 88
keep open Node.js npm-run ignores source-subdir and builds from the part root; attempted PR #1342 was closed unmerged, leaving the report unresolved.
qwen/qwen3.6-35b-a3b
Impact: 35
Quick Win: 5
Complexity: 40
Confidence: 30
Actionability: 25
keep open npm plugin does not respect source-subdir when running npm commands, causing ENOENT errors for package.json
qwen/qwen3.8-27b
Impact: 15
Quick Win: 10
Staleness: 95
Complexity: 30
Confidence: 70
Support Request: 10
close stale Legacy nodejs plugin's npm-run ignores source-subdir, so npm looks for package.json at the part src root instead of the subdir and fails with ENOENT. Reported ~2015, zero maintainer interaction; the nodejs plugin has since been removed from snapcraft.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 25
Confidence: 75
Support Request: 5
close stale Snapcraft nodejs plugin bug where npm-run ignores source-subdir, causing package.json lookup failures. Reported in 2015 with zero maintainer interaction.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 20
Confidence: 90
Support Request: 0
close stale Snapcraft nodejs plugin npm-run ignores source-subdir, causing package.json ENOENT errors. Open for over 8 years with no maintainer response or updates.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 0
close stale nodejs snapcraft plugin npm-run ignores source-subdir, causing ENOENT errors when locating package.json in the specified subdirectory.

Update history

Date Change
created

Related work

  • Related To: snapcore/snapcraft#1342 (confidence 99%)

    Reporter linked this proposed fix, but a later comment states that it was rejected.

Related issues

No related issues found above the similarity threshold.