nodejs plugin never runs install during pull

Bug #1633298 reported by Leo Arias
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Sergio Schvezov

Bug Description

In the nodejs plugin, in the _npm_install function, there are these statements:

if os.path.exists(os.path.join(self.builddir, 'package.json')):
    self.run(npm_install)

The _npm_install function is called twice, first in pull and later in build. As the path check uses the builddir, it will always be false during the pull phase. So on the pull phase, we are never running npm install.

This manifests itself in a terrible way in the augur snap. It has an npm-run target, which should run after npm install. But during pull, npm install is not run so the other target runs without the prerequisites it needs.

To reprodude:

$ sudo apt install git snapcraft
$ git clone https://github.com/elopio/augur
$ cd augur
$ git checkout snapcraft
$ snapcraft

Tags: plugin
Changed in snapcraft:
status: New → In Progress
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → 2.23
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
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.