8000 fix: latest version maybe not exists by fengmk2 · Pull Request #814 · cnpm/cnpmcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: latest version maybe not exists #814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/core/service/PackageSearchService.ts
767C
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,15 @@
const { data: manifest } = fullManifests;

const latestVersion = manifest['dist-tags'].latest;
const latestManifest = manifest.versions[latestVersion];
if (!latestVersion) {
this.logger.warn(
'[PackageSearchService.syncPackage] package:%s latestVersion not found, dist-tags: %j, skip sync',
fullname,
manifest['dist-tags']
);
return;
}

Check warning on line 100 in app/core/service/PackageSearchService.ts

View check run for this annotation

Codecov / codecov/patch

app/core/service/PackageSearchService.ts#L94-L100

Added lines #L94 - L100 were not covered by tests
const latestManifest = manifest.versions?.[latestVersion];

const packageDoc: SearchMappingType = {
name: manifest.name,
Expand Down
0