Git Product home page Git Product logo

Comments (6)

KSXGitHub avatar KSXGitHub commented on May 23, 2024

frozen-lockfile=false just means that pnpm install will not fail if the lockfile is outdated. It does not mean updating. Please use pnpm update [--latest] instead.

from pnpm.

qiulang avatar qiulang commented on May 23, 2024

Thanks for the reply but frozen-lockfile=true won't update the lock file either. So what exactly is the difference between them ?

from pnpm.

KSXGitHub avatar KSXGitHub commented on May 23, 2024

--frozen-lockfile only means that it will fail if the lockfile is not up-to-date with the package.json. This is important for CI and reproducibility.

from pnpm.

KSXGitHub avatar KSXGitHub commented on May 23, 2024

If you want to update your packages, use pnpm update.

from pnpm.

qiulang avatar qiulang commented on May 23, 2024

Thanks for the update. One of main reasons I raised my question was because 2 high score questions and answers on stackoverflow. I find the accepted answers all had some confusion.

  1. pnpm equivalent command for npm ci. This question has the highest scores in SO about pnpm. The accepted answer said pnpm install --frozen-lockfile. But after reading your comments and check the pnpm document I feel they are not exactly equivalent because pnpm dectects whether it is in CI or not automatically and it is not in CI environment it will still proceed and install according to the lock file(my confusion in the first place). But npm ci does not check whether it is in CI, it just checks whether the lock file is present or not and if it is present it will install packages according to the lock file. So I feel npm ci is more like pnpm install --frozen-lockfile=false. Am I right ?

  2. How to have pnpm install install everything exactly to the specs of the pnpm-lock file?. This question caused me another confusion. Because the question said

I'm using pnpm, is there anyway I can have pnpm install look at the existing pnpm-lock.yaml so I can eventually build a project that is entirely the same as a previous build I had 6 months ago?

But doesn't pnpm just work like that, i.e. always uses the lock file if present so we will get "entirely the same as a previous build I had 6 months ago". I was confused why he had this question in the first place at all.

from pnpm.

KSXGitHub avatar KSXGitHub commented on May 23, 2024

But after reading your comments and check the pnpm document I feel they are not exactly equivalent because pnpm dectects whether it is in CI or not automatically and it is not in CI environment it will still proceed and install according to the lock file(my confusion in the first place).

Incorrect. While pnpm install (without --frozen-lockfile) tries to detect whether the environment is a CI, pnpm install --frozen-lockfile doesn't. --frozen-lockfile always fails if lockfile is outdated or isn't present.

In short, pnpm install is equivalent to npm install (but with an extra feature to detect CI), but pnpm install --frozen-lockfile is equivalent to npm ci.

from pnpm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.