bonescript module not found in JS

Hi there,
I was learning something by following the Beaglebone cookbook.
In section 2.7, the JS code has a line like “var b = require(‘bonescript’);” which will report the MODULE_NOT_FOUND err.
I google it and try to install the bonescript by “apt install npm && npm install bonescript” but it always said something like “32 vulnerabilities (2 low, 5 moderate, 19 high, 6 critical)”.
What happened and what should I do?
Thanks