npm-run does not respect source-subdir

Bug #1694642 reported by Michał Sawicz
6
This bug affects 1 person
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-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.

Tags: sources
Leo Arias (elopio)
Changed in snapcraft:
status: New → Confirmed
importance: Undecided → High
tags: added: sources
Michał Sawicz (saviq)
Changed in snapcraft:
status: Confirmed → In Progress
Revision history for this message
Michał Sawicz (saviq) wrote :
Changed in snapcraft:
assignee: nobody → Michał Sawicz (saviq)
Revision history for this message
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)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.