.lock

How to open a .lock file

Quick, free ways to open Lockfile on any system.

A .lock file is a Dependency Lockfile / Lock Marker. If double-clicking does nothing, your computer simply does not have an app that reads Lockfile yet. Here is how to fix that on each operating system, using free software wherever possible.

Open a .lock file step by step

  1. Confirm the file really is a .lock. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
  2. On Windows, open it with any text editor (to inspect).
  3. On Mac, use any text editor (to inspect).
  4. On Linux, try any text editor (to inspect).
  5. Still stuck? Search for a dedicated Lockfile viewer.

Best apps to open .lock files

Windows

  • any text editor (to inspect)

macOS

  • any text editor (to inspect)

Linux

  • any text editor (to inspect)
!
Before you open it: Safe. Lockfiles are generated text (or empty markers) and do not execute. Do not hand-edit dependency lockfiles; regenerate them with the package manager instead.

Frequently asked questions

Why can't I open my .lock file?

Almost always because no installed app understands Lockfile. Install one of the apps above, or convert the file to a format your existing software already reads.

Should I commit lockfiles to git?

For applications, yes: yarn.lock, Cargo.lock and friends guarantee identical installs for the whole team and CI. Libraries sometimes leave them out; follow your ecosystem's convention.

Can I delete a .lock file?

A dependency lockfile: only if you intend to re-resolve all versions on the next install. A lock marker: only when the program that created it is not running, otherwise it is protecting something.

Learn more about .lock