Skip to content

Commit fd74c68

Browse files
committed
support cnpm
1 parent 35e4ab9 commit fd74c68

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/f2elint/src/private/install.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ import commandExists from 'command-exists';
33

44
export async function install(projectPath: string) {
55
let npm_command = 'npm';
6-
if (await commandExists('tnpm')) {
7-
// tnpm of Alibaba and Ant Group
8-
npm_command = 'tnpm';
9-
} else if (process.env.npm_command) {
6+
if (process.env.npm_command) {
107
// pnpm, yarn support npm_command environment variable
118
npm_command = process.env.npm_command;
9+
} else if (await commandExists('tnpm')) {
10+
// tnpm of Alibaba and Ant Group
11+
npm_command = 'tnpm';
12+
} else if (await commandExists('cnpm')) {
13+
// cnpm of China
14+
npm_command = 'cnpm';
1215
}
1316

1417
await new Promise<void>((res, rej) => {

0 commit comments

Comments
 (0)