volta
volta copied to clipboard
Global packages doesn't work
Hi! I successfully installed a couple of global packages with Volta and they're displayed in the volta list, but when I try to launch one, I get an error. It looks like this:
PS C:\Users\andre\Desktop> volta list
⚡️ Currently active tools:
Node: v18.2.0 (default)
Tool binaries available:
(default)
(default)
nodemon (default)
npm-check-updates, ncu (default)
See options for more detailed reports by running `volta list --help`.
PS C:\Users\andre\Desktop> ncu
ncu: The term 'ncu' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\andre\Desktop> nodemon
nodemon: The term 'nodemon' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
PS C:\Users\andre\Desktop>
Interestingly though that I have Volta installed in another user account (for work, in order to use older node.js version globally) and global packages works there just fine.
pls halp
Hi @Rusinas, sorry for the delay! You mentioned that Volta works correctly under a different user account. Did you install Volta initially with that other account? There are two pieces to the install:
- First, it unpacks the core binary and shims for
node,npm,npx, andyarninto theProgram Filesdirectory. - Next, it calls
volta setup, which configures the appropriate environment variables for the current user.
If you originally installed it under a different user account, you likely don't have that 2nd step set up yet. To fix that, it should be as straightforward as running volta setup under the new user account, which will then set up the Path environment variable. The existing shims (which Volta knows about as you can see from the volta list output) should then start to work because the environment is set up correctly.
Let us know if that doesn't work! I think you're actually the first person we've heard from who's using Volta from multiple accounts on the same Windows machine :smile:
I recently was having some trouble with global installs as well and wanted to share in case anyone else finds themselves here and need help. When using npm install -g PACKAGE_NAME I received an error. After setting VOLTA_LOGLEVEL to debug I got this message:
[verbose] Unlocking Volta Directory
Volta error: Could not determine the name of the package that was just installed.
Please rerun the command that triggered this error with the environment
variable `VOLTA_LOGLEVEL` set to `debug` and open an issue at
https://github.com/volta-cli/volta/issues with the details!
[verbose] No custom hooks found
I know that the new version of npm handles global installs differently now so I tried npm install --location=global PACKAGE_NAME (which the npm CLI will occasionally tell you to do in v8 but which I can't actually find documentation about on the npm website.). This time it did not error out but the package was still not actually installed. Finally I tried yarn global add PACKAGE_NAME and that seemed to do the trick.
Volta is an amazing tool btw, it's the first thing I download on a new dev machine, so thanks for all the hard work.
I experience the same issue volta version: v1.0.8, same npm-check-updates package. I am using volta from only one account.
Reproducible nowadays.