n8n/scripts/block-npm-install.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
686 B
JavaScript
Raw Permalink Normal View History

const { npm_config_user_agent: UA } = process.env;
const [packageManager] = (UA ?? '').split(' ');
const [name, version] = packageManager.split('/');
if (name !== 'pnpm') {
const suggestion = '\033[1;92mpnpm\033[0;31m';
console.error('\033[0;31m');
console.error('╭───────────────────────────────────────────╮');
console.error(`\tPlease use ${suggestion} instead of ${name} \t`);
console.error('╰───────────────────────────────────────────╯');
console.error('\033[0m');
process.exit(1);
}