volta-cli / volta

Volta: JS Toolchains as Code. ⚡
https://volta.sh
Other
11.15k stars 238 forks source link

Install Volta only for certain user (windows)? #1348

Open Rusinas opened 2 years ago

Rusinas commented 2 years ago

Volta installs for every user on the machine and you can do nothing about it. My scenario is simple: Use the latest version of Node/npm on my main user, and use specific versions of it for my "work" user, version specified in package.json files. It worked perfectly fine, but now on my main user I need to use npm link for multiple packages simultaneously, like this:

npm link package-1 package-2

Volta process them separately and I end up with only latter package linked to my project. So, the easy solution for this would be just install Volta on my "work" user, since the bug most likely caused by npm itself.

charlespierce commented 2 years ago

Hi @Rusinas, thanks for the question! At the moment, you're right that there's no way to install for a single user. That said, there are a couple of different approaches you could take:

  1. You could install it manually by setting things up using the steps defined in "Custom Installers" in our Installers docs. Note: You'll also need to install the default shims (node.exe, npm.exe, npx.exe, yarn.exe), these can be copied from the current installation if you like.
  2. You can set the environment variable VOLTA_UNSAFE_GLOBAL to 1 on the "main" user, which will disable the Volta global interception (which is what causes Volta to process npm link separately).