---
title: ":not()"
description: "Documentation for the vlt client and the vlt registry."
url: "https://docs.vlt.io/client/selectors/pseudo-classes/not"
image: "https://docs.vlt.io/og/client/selectors/pseudo-classes/not"
lang: "en"
---

# :not()

The `:not()` pseudo-class is a negation selector — it matches packages that **do not match** the given selector list. It works like the [CSS `:not()` selector](https://developer.mozilla.org/en-US/docs/Web/CSS/:not).

## Syntax

```
:not(<selector-list>)
```

## Examples

### Exclude by name

Find all packages except react:

```bash title="Terminal"
$ vlt query ':root > :not([name=react])'
```

### Exclude by license

Find packages without an MIT license:

```bash title="Terminal"
$ vlt query ':not([license=MIT])'
```

### Exclude by type

Find all non-registry dependencies:

```bash title="Terminal"
$ vlt query ':not(:type(registry))'
```

### What gets selected

Given this dependency graph:

```
my-app
├── react@18.2.0         ← license: MIT
├── typescript@5.3.0     ← license: Apache-2.0
└── vite@5.0.0           ← license: MIT
```

`:root > :not([license=MIT])` selects:

```
my-app
├── react@18.2.0
├── typescript@5.3.0      ✅ license is NOT MIT
└── vite@5.0.0
```

### Combining with other pseudo-classes

Find non-dev dependencies that are outdated:

```bash title="Terminal"
$ vlt query ':not(:dev):outdated'
```

Find packages that are not private and not workspaces:

```bash title="Terminal"
$ vlt query ':not(:private):not(:workspace)'
```

## See also

- [`:is()`](https://docs.vlt.io/client/selectors/pseudo-classes/is.md) — forgiving selector list matching
- [`:has()`](https://docs.vlt.io/client/selectors/pseudo-classes/has.md) — dependency matching
