You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewUsageError(`Couldn't find a project in the local directory - please specify the package manager to pack, or run this command from a valid project`);
17
17
18
18
case`NoSpec`:
19
-
thrownewUsageError(`The local project doesn't feature a 'packageManager' field - please specify the package manager to pack, or update the manifest to reference it`);
19
+
thrownewUsageError(`The local project doesn't feature a 'packageManager' field nor a 'devEngines.packageManager' field - please specify the package manager to pack, or update the manifest to reference it`);
console.warn(`! Corepack only supports objects as valid value for devEngines.packageManager. The current value (${JSON.stringify(packageManager)}) will be ignored.`);
85
+
returnpm;
86
+
}
87
+
if(Array.isArray(packageManager)){
88
+
console.warn(`! Corepack does not currently support array values for devEngines.packageManager`);
89
+
returnpm;
90
+
}
91
+
92
+
const{name, version, onFail}=packageManager;
93
+
if(typeofname!==`string`||name.includes(`@`)){
94
+
warnOrThrow(`The value of devEngines.packageManager.name ${JSON.stringify(name)} is not a supported string value`,onFail);
warnOrThrow(`The value of devEngines.packageManager.version ${JSON.stringify(version)} is not a valid semver range`,onFail);
99
+
returnpm;
100
+
}
101
+
102
+
debugUtils.log(`devEngines.packageManager defines that ${name}@${version} is the local package manager`);
103
+
104
+
if(pm){
105
+
if(!pm.startsWith?.(`${name}@`))
106
+
warnOrThrow(`"packageManager" field is set to ${JSON.stringify(pm)} which does not match the "devEngines.packageManager" field set to ${JSON.stringify(name)}`,onFail);
warnOrThrow(`"packageManager" field is set to ${JSON.stringify(pm)} which does not match the value defined in "devEngines.packageManager" for ${JSON.stringify(name)} of ${JSON.stringify(version)}`,onFail);
warnOrThrow(`The requested version of ${info.locator.name}@${info.locator.reference} does not match the devEngines specification (${range.name}@${range.range})`,range.onFail);
0 commit comments