2

I have a debian package with npm build dependency, e.g, the control file contains the line:

Build-Depends: debhelper (>= 11), npm

Building this package works fine if I have installed nodejs using apt-get, which creates the file /usr/bin/npm. The problem is that on my current system I have installed nodejs using nvm, which installs everything to the home folder and adds the ~.nvm/versions/node/v12.16.1/bin folder to PATH. Now when trying to build the debian package, I get:

dpkg-checkbuilddeps: error: Unmet build dependencies: npm

even though the npm command works when used in the shell. Is there a way to use binaries installed to the home folder to satisfy the build dependencies?

user2563661
  • 233
  • 1
  • 4
  • Hopefully not. If there should be any sense in declaring a build dependency on npm, the package must build with what's installed by npm, and not something that might be available in *your* path. – Henrik supports the community Feb 26 '20 at 15:09

1 Answers1

2

You can disable the build-dependency check using dpkg-buildpackage’s -d option:

dpkg-buildpackage -d

Whether that ends up using your locally-installed npm binary will depend on the details of the build system, but I think it should do so.

The result might not match what the package maintainer intended, but if anything breaks, you’ll still have all the pieces...

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164