Git Product home page Git Product logo

Comments (2)

sixclones avatar sixclones commented on June 5, 2024 1

Oh I see, it totally makes sense now, thanks for the detailed answer.

I think that what's you're explaining is in fact contained in this sentence: "Volta respects the configuration of the project you’re in". But I think that adding a precision over what "the configuration of the project" is might greatly help to make docs clearer.
For example, simply adding "the configuration of the project (e.g. the package.json file of the current directory)" might easily help.

Also I think that what you explained to me in your comment covers the whole thing so it would be good to put it in the documentation in my opinion 👍

from volta.

chriskrycho avatar chriskrycho commented on June 5, 2024

That is not what the docs are trying to say, but I totally understand why you are reading them that way! What the docs are trying to say is: you can install a “global” version of a tool like TypeScript, and any time you are somewhere on your system which does not have TypeScript installed, it will use the globally installed version, but when in a project which does have TypeScript installed, it will use that project’s version instead. In other words, exactly the behavior you are seeing!

So, to be extra clear:

  • There will only ever be a single copy of a given global (or “user default”) installation of a package. When you ran npm install -g typescript again with a different version, it replaced the previous global installation—just like it would with a normal npm install -g, but with Volta’s extra isolation.

  • When you have installed both a global and a package-local version of a given tool, Volta will use the package-local version. That way, the version you get in a project is always the version from the project. It would be annoying if installing a global version made it so the version in your project did not work!

  • Volta does not support having a per-directory version of a given package or tool apart from configuring it explicitly with the volta key (for Node and package managers) or adding it to your dependencies (for packages) in package.json.

Hopefully that clears things up a bit! If you have thoughts on how we could word that bit of our documentation better, we would welcome it—and feel free to open a PR to help fix it, too!

from volta.

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.