Skip to content

Commit bad66ad

Browse files
fix: unable to use yarn on Windows
When you've set package manager to `yarn` on Windows, CLI is unable to create a project - it hangs during the operation. The problem is that getting the path to yarn cache returns result with `\n` at the end. This makes the `pacote` package hangs instead of just failing. Fix this by trimming the result of `yarn cache dir` call.
1 parent f3bae6f commit bad66ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/yarn-package-manager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class YarnPackageManager extends BasePackageManager {
9696
@exported("yarn")
9797
public async getCachePath(): Promise<string> {
9898
const result = await this.$childProcess.exec(`yarn cache dir`);
99-
return result;
99+
return result.toString().trim();
100100
}
101101
}
102102

0 commit comments

Comments
 (0)