Allow `corepack use` with default package manager when network disabled `COREPACK_ENABLE_NETWORK=0`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Bắt đầu từ điểm đầu vào của lệnh corepack use và theo dõi cách phiên bản trình quản lý gói được phân giải khi COREPACK_ENABLE_NETWORK=0. Tái hiện lỗi bằng các lệnh và môi trường trong issue, sau đó xác minh rằng corepack use yarn chọn phiên bản được cài đặt toàn cục từ lastKnownGood.json mà không cần truy cập mạng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What would you like?
corepack use should default to the package manager version stored in lastKnownGood.json when network connections are disabled with COREPACK_ENABLE_NETWORK=0.
For example
corepack use yarn
should work if previously Yarn was globally installed:
corepack install -g yarn@<specific-version>
Why is this needed?
Version-independent workflows including for example corepack use yarn should still work with no network available.
Steps to reproduce
Ubuntu 22.04.2 LTS, Node.js 22.14.0 LTS, Corepack 0.32.0
rm -rf ~/.cache/node/corepack
corepack install -g yarn@4.8.0
export COREPACK_ENABLE_NETWORK=0
cd $(mktemp -d)
corepack use yarn # fails
corepack use yarn@4.8.0 # succeeds
Logs
Failure
$ corepack use yarn # fails
Usage Error: Network access disabled by the environment; can't reach npm repository https://registry.npmjs.org
$ corepack use <pattern>
Success
$ corepack use yarn@4.8.0 # succeeds
Installing yarn@4.8.0 in the project...
➤ YN0000: · Yarn 4.8.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 0s 78ms
- Ngôn ngữ chính
- TypeScript
- Star
- 3.8k
- Fork
- 279
- Merge trung bình
- 1 giờ 47 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nodejs/corepack
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của nodejs/corepack
Issue tương tự
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100