summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/npm/managed/resolvers/local.rs6
-rw-r--r--tests/specs/install/workspace_member_with_tag_dep/__test__.jsonc9
-rw-r--r--tests/specs/install/workspace_member_with_tag_dep/install.out3
-rw-r--r--tests/specs/install/workspace_member_with_tag_dep/package.json6
-rw-r--r--tests/specs/install/workspace_member_with_tag_dep/package1/package.json5
5 files changed, 26 insertions, 3 deletions
diff --git a/cli/npm/managed/resolvers/local.rs b/cli/npm/managed/resolvers/local.rs
index 59ba27d05..edc7c7ea0 100644
--- a/cli/npm/managed/resolvers/local.rs
+++ b/cli/npm/managed/resolvers/local.rs
@@ -518,9 +518,9 @@ async fn sync_resolution_with_fs(
// linked into the root
match found_names.entry(remote_alias) {
Entry::Occupied(nv) => {
- alias_clashes
- || remote.req.name != nv.get().name // alias to a different package (in case of duplicate aliases)
- || !remote.req.version_req.matches(&nv.get().version) // incompatible version
+ // alias to a different package (in case of duplicate aliases)
+ // or the version doesn't match the version in the root node_modules
+ alias_clashes || &remote_pkg.id.nv != *nv.get()
}
Entry::Vacant(entry) => {
entry.insert(&remote_pkg.id.nv);
diff --git a/tests/specs/install/workspace_member_with_tag_dep/__test__.jsonc b/tests/specs/install/workspace_member_with_tag_dep/__test__.jsonc
new file mode 100644
index 000000000..254fe8b98
--- /dev/null
+++ b/tests/specs/install/workspace_member_with_tag_dep/__test__.jsonc
@@ -0,0 +1,9 @@
+{
+ "tempDir": true,
+ "steps": [
+ {
+ "args": "install",
+ "output": "install.out"
+ }
+ ]
+}
diff --git a/tests/specs/install/workspace_member_with_tag_dep/install.out b/tests/specs/install/workspace_member_with_tag_dep/install.out
new file mode 100644
index 000000000..b8114c12a
--- /dev/null
+++ b/tests/specs/install/workspace_member_with_tag_dep/install.out
@@ -0,0 +1,3 @@
+Download http://localhost:4260/@denotest/esm-basic
+Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz
+Initialize @denotest/esm-basic@1.0.0
diff --git a/tests/specs/install/workspace_member_with_tag_dep/package.json b/tests/specs/install/workspace_member_with_tag_dep/package.json
new file mode 100644
index 000000000..58aa5d5cc
--- /dev/null
+++ b/tests/specs/install/workspace_member_with_tag_dep/package.json
@@ -0,0 +1,6 @@
+{
+ "dependencies": {
+ "@denotest/esm-basic": "latest"
+ },
+ "workspaces": ["package1"]
+}
diff --git a/tests/specs/install/workspace_member_with_tag_dep/package1/package.json b/tests/specs/install/workspace_member_with_tag_dep/package1/package.json
new file mode 100644
index 000000000..150a7df6a
--- /dev/null
+++ b/tests/specs/install/workspace_member_with_tag_dep/package1/package.json
@@ -0,0 +1,5 @@
+{
+ "dependencies": {
+ "@denotest/esm-basic": "latest"
+ }
+}