package-lock.json
A dependency lock file automatically generated by npm that precisely records the version of every package in the dependency tree, ensuring consistency of dependency installation across different environments.
Core Facts
Lockfiles (such as pnpm-lock.yaml, package-lock.json, yarn.lock) record every dependency actually installed by the project and its exact version; when a direct dependency requires a higher version, the package manager will bump the lockfile entry, which may trigger synchronized changes in indirect dependencies.
It is recommended to use package-lock.json or pnpm-lock.yaml to precisely lock the actually installed versions, and to submit upgrade PRs on a scheduled basis via tools such as Dependabot or Renovate.
A lockfile (such as package-lock.json or pnpm-lock.yaml) records the exact version and integrity checksum hash of every package in the entire dependency tree, ensuring consistent installation results across different environments.
Timeline (last 90 days)
If package.json specifies ^2.0.15, npm/pnpm will only pull 2.0.16 on reinstall; if a package-lock.json or pnpm-lock.yaml already exists, it stays unchanged, and you must explicitly run npm update @ai-sdk/zai or delete the lockfile and reinstall.
A lockfile is a file generated by a package manager after installing dependencies, recording the exact version, download address and integrity checksum of each dependency package.
npm's peerDependencies constraints and lockfiles (package-lock.json, pnpm-lock.yaml) are the first place to look when troubleshooting dependency version mismatches.
Manifest files (such as package.json, requirements.txt, Cargo.toml) declare project dependencies and version ranges; lock files (such as package-lock.json, poetry.lock, Cargo.lock) precisely record the actual installed version of each dependency and the complete dependency tree.
The way to prevent Runner environment drift is: generate a baseline on a clean code tree with sha256sum package-lock.json > env.lock, and write preflight.sh to verify the environment lock and whether the Git working tree is clean before each attempt.
After a patch upgrade, dependencies need to be reinstalled and integration tests run, because the lockfile does not automatically follow version changes in package.json.
package-lock.json records the exact versions actually installed, and this file should be committed during team collaboration to ensure all members have consistent environments.
Lockfiles (such as pnpm-lock.yaml, package-lock.json, yarn.lock) record every dependency actually installed by the project and its exact version; when a direct dependency requires a higher version, the package manager will bump the lockfile entry, which may trigger synchronized changes in indirect dependencies.
npm generates package-lock.json (or pnpm's pnpm-lock.yaml) recording the full dependency tree hash, and npm ci installs according to the lock file to guarantee reproducible builds.
Common means of avoiding duplicate dependency versions include: using npm ls ai to check for duplicate dependencies, pinning versions in the lockfile, or keeping adapter packages and the core package within the same minor version range.
10 more timeline events
All Facts (20)
Lockfiles (such as pnpm-lock.yaml, package-lock.json, yarn.lock) record every dependency actually installed by the project and its exact version; when a direct dependency requires a higher version, the package manager will bump the lockfile entry, which may trigger synchronized changes in indirect dependencies.
75%VerifiedIt is recommended to use package-lock.json or pnpm-lock.yaml to precisely lock the actually installed versions, and to submit upgrade PRs on a scheduled basis via tools such as Dependabot or Renovate.
75%VerifiedA lockfile (such as package-lock.json or pnpm-lock.yaml) records the exact version and integrity checksum hash of every package in the entire dependency tree, ensuring consistent installation results across different environments.
75%UnverifiedIf package.json specifies ^2.0.15, npm/pnpm will only pull 2.0.16 on reinstall; if a package-lock.json or pnpm-lock.yaml already exists, it stays unchanged, and you must explicitly run npm update @ai-sdk/zai or delete the lockfile and reinstall.
70%UnverifiedA lockfile is a file generated by a package manager after installing dependencies, recording the exact version, download address and integrity checksum of each dependency package.
50%Unverifiednpm's peerDependencies constraints and lockfiles (package-lock.json, pnpm-lock.yaml) are the first place to look when troubleshooting dependency version mismatches.
50%UnverifiedManifest files (such as package.json, requirements.txt, Cargo.toml) declare project dependencies and version ranges; lock files (such as package-lock.json, poetry.lock, Cargo.lock) precisely record the actual installed version of each dependency and the complete dependency tree.
50%UnverifiedThe way to prevent Runner environment drift is: generate a baseline on a clean code tree with sha256sum package-lock.json > env.lock, and write preflight.sh to verify the environment lock and whether the Git working tree is clean before each attempt.
50%UnverifiedAfter a patch upgrade, dependencies need to be reinstalled and integration tests run, because the lockfile does not automatically follow version changes in package.json.
50%Unverifiedpackage-lock.json records the exact versions actually installed, and this file should be committed during team collaboration to ensure all members have consistent environments.
50%Unverifiednpm generates package-lock.json (or pnpm's pnpm-lock.yaml) recording the full dependency tree hash, and npm ci installs according to the lock file to guarantee reproducible builds.
50%UnverifiedCommon means of avoiding duplicate dependency versions include: using npm ls ai to check for duplicate dependencies, pinning versions in the lockfile, or keeping adapter packages and the core package within the same minor version range.
50%UnverifiedFor 0.x version dependencies, a more reliable approach is to use an exact version number (such as 0.0.93) or the ~ prefix together with a lockfile (package-lock.json), and to verify via npm audit and the changelog.
50%Unverifiednpm's package-lock.json locks the exact hash of every dependency, and npm audit interfaces with the NVD to automatically cross-reference known CVEs.
50%UnverifiedDependency locking mechanisms in software supply chain security (such as npm's package-lock.json and Python's requirements.txt hash locking) alert against silent updates by fixing dependency versions and integrity fingerprints.
50%UnverifiedA lockfile precisely records the exact version and integrity hash of every package across the entire dependency tree, ensuring a consistent dependency snapshot is installed across different environments.
50%UnverifiedUsing lock files (package-lock.json or yarn.lock) can pin dependency versions and avoid inconsistency issues caused by version drift.
50%UnverifiedIn modern front-end engineering, lockfiles (such as package-lock.json and pnpm-lock.yaml) record the exact versions and hash values of the dependency tree, ensuring that team members, CI/CD environments, and production deployments use identical dependency versions.
50%UnverifiedIn production environments, lock files such as package-lock.json or pnpm-lock.yaml should be committed to version control to ensure that team members and CI environments use a consistent dependency tree.
50%Unverifiednpm 使用 package-lock.json,pnpm 使用 pnpm-lock.yaml,Yarn 使用 yarn.lock,Bun 使用 bun.lockb(二进制格式)作为锁文件
50%