Skip to content

Commit 8a9aa7c

Browse files
committed
fix: look at the right spot for version warning
1 parent b38cb40 commit 8a9aa7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ interface Variables {
1414

1515
export default async function (root: string, variables: Variables) {
1616
const actualContent = await readFile(join(root, "package.json"), { encoding: "utf8" });
17-
const actualPkg = JSON.parse(actualContent) as { name: string; dependencies?: Record<string, string> };
18-
if (actualPkg.name !== ownPkg.name && actualPkg.dependencies?.[ownPkg.name] !== ownPkg.version) {
19-
console.log(`ERROR! The dependency "${ownPkg.name}" must be set to the exact version "${ownPkg.version}"`);
17+
const actualPkg = JSON.parse(actualContent) as { name: string; devDependencies?: Record<string, string> };
18+
if (actualPkg.name !== ownPkg.name && actualPkg.devDependencies?.[ownPkg.name] !== ownPkg.version) {
19+
console.log(`ERROR! The devDependency "${ownPkg.name}" must be set to the exact version "${ownPkg.version}"`);
2020
console.log(`Try running \`npm install --save-exact -D ${ownPkg.name}\``);
2121
process.exit(1);
2222
}

0 commit comments

Comments
 (0)