'Volta and global npm package
I try Volta tools on existing Node project. This is very great tools :)
But, can i use global package ? For example, i've run :
npm i -g gitmoji-cli
Then, i try to use gitmoji, but it's undefined on the command line. I'm on the right node version, but i don't really understand why the gitmoji is not found.
Do you know if I need other param ?
If anyone have already use this tool and installing global package .. :)
Solution 1:[1]
You can install global packages using volta install <package>. In your case, it would be volta install gitmoji-cli.
Volta will then install the package and make it available anywhere in your terminal. However, if you open the terminal in a project that has that package listed as a dependency, or dev dependency, Volta will use the package from the node_modules of that project instead.
For more information see: global-installs-done-right
Solution 2:[2]
Yes, Volta works Well with global package installation.
I try your command and it's OK:
npm i -g gitmoji-cli
if it's not working for you, try openning "cmd" with "Run as administrator" option.
or, as volta documentation recommends, enable "Developer Mode" in Windows:
NOTE
Volta's functionality depends on creating symlinks, so you must either:
Enable Developer Mode (recommended)
Run Volta with elevated privileges (not recommended)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Masoud Keshavarz |
| Solution 2 | Ihor Konovalenko |

