Skip to content

Commit a241fb7

Browse files
committed
Fixes yarn install with private packages
1 parent 1f0a89d commit a241fb7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/registries/npm-registry.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export default class NpmRegistry extends Registry {
8484
opts.headers,
8585
);
8686

87-
if (alwaysAuth || (packageName || pathname)[0] === `@`) {
87+
const packageIdent = packageName || pathname;
88+
const isScoppedPackage = packageIdent.match(/^@|\/@/);
89+
90+
if (alwaysAuth || isScoppedPackage) {
8891
const authorization = this.getAuth(packageName || pathname);
8992
if (authorization) {
9093
headers.authorization = authorization;

0 commit comments

Comments
 (0)