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)