diff --git a/src/install/install.zig b/src/install/install.zig index 0e698674f9dae..747e4be4d8223 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -4201,6 +4201,8 @@ pub const PackageManager = struct { }; } else if (behavior.isPeer() and !install_peer) { return null; + } else if (behavior.isOptional() and !this.options.remote_package_features.optional_dependencies) { + return null; } // appendPackage sets the PackageID on the package