npm-run does not respect source-subdir

Bug #1694642 reported by Michał Sawicz on 2017-05-31
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Given a 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.

Leo Arias (elopio) on 2017-05-31
Changed in snapcraft:
status: New → Confirmed
importance: Undecided → High
tags: added: sources
Michał Sawicz (saviq) on 2017-06-01
Changed in snapcraft:
status: Confirmed → In Progress
Michał Sawicz (saviq) wrote :
Changed in snapcraft:
assignee: nobody → Michał Sawicz (saviq)
Gustavo Silva (gsilvapt) wrote :

The PR Has been rejected in June. Are you still working on this? If you're not and being a high priority bug, perhaps we should assign to nobody and change status to Confirmed.

Michał Sawicz (saviq) on 2018-02-26
Changed in snapcraft:
assignee: Michał Sawicz (saviq) → nobody
status: In Progress → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers