Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

npm version lookups ignore the registry configured in .npmrc

Đang mở
#7,634 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
backend

Hướng nghiên cứu

Start by locating NpmVersionResolver and YarnVersionResolver, which the issue identifies as fetching versions directly from the public registry; inspect their tests and the install-npm entry point to see how resolution is invoked. Compare those lookups with npm's configured registry and credential behavior. Done means private .npmrc registries and credentials are honored for latest and partial-version lookups, with regression tests covering those cases.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

type:bug

Bug

The npm version resolver ignores the registry configured in .npmrc.

NpmVersionResolver and YarnVersionResolver look versions up directly at https://registry.npmjs.org/<package>; only containerbase's URL replacements are applied. The scope registries and credentials from .npmrc (eg. @corp:registry=https://npm.corp.example with an auth token) are never used. The install itself runs npm, which does use them.

So a package that only exists on a private registry can't be resolved:

  • install-npm @corp/tool (no version or latest) fails today, because the latest dist tag is fetched from the public registry.
  • install-npm @corp/tool 5 fails the same way once partial versions are resolved (#7633); before, 5 was passed through to npm unchanged.

A full version like install-npm @corp/tool 5.1.0 works, because it skips the lookup.

Expected

Version lookups use the same registry and credentials as the install, so latest and partial versions work for packages from any registry configured in .npmrc. One option is to ask npm itself, eg. npm view <package>@<range> version --json, since install-npm requires node anyway.

Context

Found by CodeRabbit on #7633 and deferred, since latest already has the problem.


Opened by Claude Opus 5.5 in Claude Code on behalf of @viceice.

Ngôn ngữ chính
TypeScript
Star
58
Fork
65
Merge trung bình
10 giờ 37 phút
Pull request đã merge (30 ngày)
462

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của containerbase/base

Tất cả issue của containerbase/base

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.