> ## Documentation Index
> Fetch the complete documentation index at: https://jncpkg.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Lock File

> How jnc uses lock files for reproducible environments.

# Lock File

jnc automatically generates and maintains a `jnc.lock` file in your workspace. The lock file records the exact versions and hashes of every package resolved for each environment and platform, ensuring fully reproducible builds.

## How it works

1. When you run `jnc add`, `jnc install`, or any command that modifies dependencies, jnc solves the environment and writes the results to `jnc.lock`.
2. The lock file contains the exact version, build string, and content hash for every package.
3. On subsequent installs, jnc reads the lock file and installs the exact same packages — no re-solving required.

## Committing the lock file

**Always commit `jnc.lock` to version control.** This ensures that every developer and CI system gets the same environment.

```
jnc.toml     # Source of truth for dependency constraints
jnc.lock     # Exact resolved versions (auto-generated)
```

## Updating the lock file

### Update all dependencies

```bash theme={null}
jnc update
```

Re-solves all dependencies within the constraints defined in `jnc.toml` and updates the lock file.

### Update specific packages

```bash theme={null}
jnc update numpy pandas
```

### Upgrade with loosened constraints

```bash theme={null}
jnc upgrade numpy
```

This loosens the version constraint in the manifest and re-solves.

## Frozen and locked modes

### Frozen

Install exactly what's in the lock file, even if the manifest has changed:

```bash theme={null}
jnc install --frozen
```

### Locked

Install from the lock file, but abort if the lock file is out of date with the manifest:

```bash theme={null}
jnc install --locked
```

This is useful in CI to catch lock file drift.

## Lock file for multiple platforms

The lock file contains solutions for every platform listed in your manifest:

```toml theme={null}
[project]
platforms = ["linux-aarch64"]
```

The `linux-aarch64` platform is solved and recorded in `jnc.lock`, targeting NVIDIA Jetson (JetPack 6) devices. Additional platforms may be supported in the future.
