JavaScript & Debian tips

Take also a look at known patches.

Find and fix missing/broken dependencies

Use this if you're not able to fix the problem.

Example: jest --ci or rollup -c fail.

Install missing modules

  1. install only modules that don't exist in Debian: pkgjs-install and retest command

  2. if command still fails, maybe a dependency version mismatch, then install modules that mismatch Debian version: pkgjs-install --strict and retest

  3. if command still fails, maybe a Debian package is broken, then use a normal install: npm install --ignore-scripts

  4. if command still fails, try to fix the problem, then restart this process

Reduce needed non-Debian dependencies

If you're not able to keep only needed modules in node_modules/ directory, you can use reduce-nodejs from Yadd's tools.

Example: reduce-nodejs jest --ci.

You can launch reduce-nodejs more than one time if you think that some modules are superfluous. At the end of the process, node_modules/ directory contains:

You can use check-nodejs from Yadd's tools to show Debian problems.

And then ?