File size: 333 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 |
const { exec } = require('child_process');
exec('npm -v', (err, stdout) => {
if (err) throw err;
if (parseFloat(stdout) < 5) {
// NOTE: This can happen if you have a dependency which lists an old version of npm in its own dependencies.
throw new Error(`[ERROR] You need npm version @>=5 but you have ${stdout}`);
}
});
|