GithubHelp home page GithubHelp logo

Comments (7)

appsbytom avatar appsbytom commented on June 9, 2024 1

Very true, thanks again for the suggestions 😄

from lockfile-lint.

lirantal avatar lirantal commented on June 9, 2024

Totally understand where this is helpful to force a specific one version for the team, but I think this shouldn't be done with lockfile-lint, but rather with something like nvm's .nvmrc (see here: https://github.com/nvm-sh/nvm#nvmrc) or if you use fnm then the corresponding config.

Does that make sense?

from lockfile-lint.

appsbytom avatar appsbytom commented on June 9, 2024

I see what you mean with .nvmrc however that doesn't force the version as the developer needs to remember to run nvm use. So it's possible if the developer uses a different default Node version to what the project uses it can be missed.
Also using a specific Node version doesn't always mean that the npm versions are the same.

Current example is, I use the default npm version with Node 10 however a team member had upgraded to the latest npm while still on Node 10. This meant I was on lockfileVersion 1 and they were on 2

from lockfile-lint.

lirantal avatar lirantal commented on June 9, 2024

lockfileVersion 2 is actually backwards compatible with lockfileVersion 1 :-)

So, some ideas for other workarounds that can apply here:

  1. You can specify the Node.js runtime versions, and also the npm runtime version with package.json's engines field. See here
  2. You can also explicitly have a .npmrc file with a lockfile-version configuration setting to force it.

Any of this is helpful?

from lockfile-lint.

appsbytom avatar appsbytom commented on June 9, 2024

It may be compatible but we had the issue of the package-lock rewriting itself to match the correct schema for the npm version used and switching back and forth. So wanted to have something that would automatically flag this.

lockfile-version in .npmrc is a good idea though, thanks.

Looking more at .npmrc, wouldn't the registry key do similar as to the checks here for hosts, https?

from lockfile-lint.

lirantal avatar lirantal commented on June 9, 2024

lockfile-version in .npmrc is a good idea though, thanks.

🤗

Looking more at .npmrc, wouldn't the registry key do similar as to the checks here for hosts, https?

Nope. It doesn't force a trust policy, but merely sets the default upstream repository for when you do npm install.

from lockfile-lint.

lirantal avatar lirantal commented on June 9, 2024

Anytime!
Thank you for bringing this up and brainstorming with us ❤️

from lockfile-lint.

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.