@@ -78,6 +78,8 @@ class PackageManager {
78
78
if ( ! SUPPORTED_PACKAGE_MANAGERS . includes ( this . bin ) ) {
79
79
throw new Error ( `Unknown package manager: ${ this . bin } ` )
80
80
}
81
+
82
+ this . execBin = process . env . VUE_CLI_PACKAGE_MANAGER_BIN || this . bin
81
83
}
82
84
83
85
// Any command that implemented registry-related feature should support
@@ -162,7 +164,7 @@ class PackageManager {
162
164
163
165
async install ( ) {
164
166
const args = await this . addRegistryToArgs ( PACKAGE_MANAGER_CONFIG [ this . bin ] . install )
165
- return executeCommand ( this . bin , args , this . context )
167
+ return executeCommand ( this . execBin , args , this . context )
166
168
}
167
169
168
170
async add ( packageName , isDev = true ) {
@@ -171,7 +173,7 @@ class PackageManager {
171
173
packageName ,
172
174
...( isDev ? [ '-D' ] : [ ] )
173
175
] )
174
- return executeCommand ( this . bin , args , this . context )
176
+ return executeCommand ( this . execBin , args , this . context )
175
177
}
176
178
177
179
async upgrade ( packageName ) {
@@ -192,15 +194,15 @@ class PackageManager {
192
194
...PACKAGE_MANAGER_CONFIG [ this . bin ] . add ,
193
195
packageName
194
196
] )
195
- return executeCommand ( this . bin , args , this . context )
197
+ return executeCommand ( this . execBin , args , this . context )
196
198
}
197
199
198
200
async remove ( packageName ) {
199
201
const args = [
200
202
...PACKAGE_MANAGER_CONFIG [ this . bin ] . remove ,
201
203
packageName
202
204
]
203
- return executeCommand ( this . bin , args , this . context )
205
+ return executeCommand ( this . execBin , args , this . context )
204
206
}
205
207
}
206
208
0 commit comments