4

We ran into this problem while packaging some software written in nodejs.

Because we can't package each and every dependency separately, we need to ship the node_modules/ directory along with the program. The code is installed into usr/share/<project>/..., and these are the warnings (and errors) that generates:

W: <project>: extra-license-file usr/share/<project>/node_modules/express/node_modules/mkdirp/LICENSE
E: <project>: wrong-path-for-interpreter usr/share/<project>/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu (#!/opt/local/bin/gnuplot != /usr/bin/gnuplot)

There are hundreds of these.

I understand that all of those errors are relevant and meaningful, but I don't know how to get rid of them without cheating and without packaging each dependency separately. Is there another directory in the FHS in which a directory full of rubbish, like node_modules/, would be okay?

We've also looked into running npm install as part of the post install script, but decided we can't do that (for security and maintenance reasons)

1 Answers1

3

The warning/errors don't actually seem to have anything to do with the fact that you're installing them into a usr/share/<project>/node_modules directory. AFAICT, you'd be generating them wherever you install them.

As the docs mention, Lintian warning/errors can be overridden to silence them. Create a file called <package>.lintian-overrides in the debian directory of the source package. It should look something like:

<package> binary: wrong-path-for-interpreter *
<package> binary: extra-license-file *

Though the extra-license-file can be solved easily with this snippet for debian/rules:

override_dh_auto_install:
    find . -name "LICENSE" -delete
    dh_auto_install

There is a lintian-overrider tool that automates writing Lintian overrides. It can be used like so:

lintian -o <path/to/your/changes-file.changes> | \
      lintian-overrider --there-are-no-issues --source-dir <path/to/unpacked/source-tree>

More information can be found in the author's blog post.