npm-run does not respect source-subdir
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Confirmed
|
High
|
Unassigned |
Bug Description
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-
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! path /tmp/nodejs-
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/nodejs-
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/nodejs-
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-
Command '['/bin/sh', '/tmp/tmpri054knq', 'npm', 'run', 'foo']' returned non-zero exit status 254.
Changed in snapcraft: | |
status: | New → Confirmed |
importance: | Undecided → High |
tags: | added: sources |
Changed in snapcraft: | |
status: | Confirmed → In Progress |
Changed in snapcraft: | |
assignee: | Michał Sawicz (saviq) → nobody |
status: | In Progress → Confirmed |
PR: https:/ /github. com/snapcore/ snapcraft/ pull/1342