fix preinstall script (#136638)

detect yarn with .cjs extensions
This commit is contained in:
Johannes Herchen 2021-11-08 09:50:56 +01:00 committed by GitHub
parent 8d5348aba6
commit 00d94046fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ if (majorYarnVersion < 1 || minorYarnVersion < 10) {
err = true;
}
if (!/yarn[\w-.]*\.js$|yarnpkg$/.test(process.env['npm_execpath'])) {
if (!/yarn[\w-.]*\.c?js$|yarnpkg$/.test(process.env['npm_execpath'])) {
console.error('\033[1;31m*** Please use yarn to install dependencies.\033[0;0m');
err = true;
}