diff --git a/package.json b/package.json index 525523f28..af837f4d6 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "yarn": "./dist/yarn.js", "yarnpkg": "./dist/yarnpkg.js" }, - "packageManager": "yarn@^2.0.0-rc.29", + "packageManager": "yarn@2.0.0-rc.29", "devDependencies": { "@babel/core": "^7.11.0", "@babel/plugin-proposal-class-properties": "^7.10.4", diff --git a/sources/specUtils.ts b/sources/specUtils.ts index a3fcb79a3..3d85e370f 100644 --- a/sources/specUtils.ts +++ b/sources/specUtils.ts @@ -12,8 +12,8 @@ export function parseSpec(raw: unknown, source?: string): Descriptor { throw new UsageError(`Invalid package manager specification in ${source}; expected a string`); const match = raw.match(/^(?!_)(.+)@(.+)$/); - if (match === null || !semver.validRange(match[2])) - throw new UsageError(`Invalid package manager specification in ${source}; expected a semver range`); + if (match === null || !semver.valid(match[2])) + throw new UsageError(`Invalid package manager specification in ${source}; expected a semver version`); if (!isSupportedPackageManager(match[1])) throw new UsageError(`Unsupported package manager specification (${match})`); @@ -109,7 +109,7 @@ export async function loadSpec(initialCwd: string): Promise { } export async function persistPmSpec(updateTarget: string, locator: Locator, message: string) { - const newSpec = `${locator.name}@^${locator.reference}`; + const newSpec = `${locator.name}@${locator.reference}`; let res: boolean; try {