Packaging nodejs apps

Didier Roche didrocks at
Mon Nov 14 10:34:17 UTC 2016

Le 14/11/2016 à 10:55, Stephen Stewart a écrit :
> Hi,
> While looking into a nodejs/yarn plugin I wondered if I could make a
> yarn snap (not plugin), and simply define nodejs and yarn as parts,
> use dump plugin and be done, no plugin required:
> "Parts 'yarn' and 'node' have the following file paths in common which
> have different contents:"
> So I am wondering why doesn't this just work?

Hey Stephen,

It doesn't work simply because snapcraft doesn't know which file from
which part to ship. You have common files between parts with different
contents (as the error message underline). Which one of yarn's or node's should be included for instance?
> It seems like name collisions in parts might be a common enough thing,
> and I couldn't quite understand the help docs around filesets and
> organise to see a nice way to make this work for me across projects.

I guess will be a
better example.
Basically, you define in one parts a fileset with:
    - - LICENSE
    - -lib/constants.js
(note the - to say to exclude those 3 files).

then, in the same part you want to exclude those files:
stage: [$exclude]
snap: [$exclude]

And you should be done!

More information about the Snapcraft mailing list