Skip to content

Commit

Permalink
fix: account for npx package-name with no spec
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Apr 18, 2023
1 parent 997bcdf commit 0f968fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions workspaces/libnpmexec/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ const getManifest = async (spec, flatOptions) => {
// Returns the required manifest if the spec is missing from the tree
// Returns the found node if it is in the tree
const missingFromTree = async ({ spec, tree, flatOptions }) => {
if (spec.registry && spec.type !== 'tag') {
// spec.raw === spec.name if they asked for just the package by name, so we need
// to check the resolved to see if there's a newer version
if (spec.registry && spec.type !== 'tag' && (spec.raw !== spec.name)) {
// registry spec that is not a specific tag.
const nodesBySpec = tree.inventory.query('packageName', spec.name)
for (const node of nodesBySpec) {
// package requested by name only (or name@*)
if (spec.rawSpec === '*') {
if (spec.rawSpec === '*' ) {
return { node }
}
// package requested by specific version
Expand Down

0 comments on commit 0f968fe

Please sign in to comment.