Open luxzeitlos opened 6 years ago
@luxferresum In brief, nn
add PATH
once at installation. It does not change PATH
when using it.
The PATH
added are:
~/.nn/bin
: executable is placed here, which is nn
(for Linux, macOS) or nn.exe
(for Windows)~/.nn/current
: A soft link(for Linux, macOS) or junction(for Windows) which points to active versionSee install.sh and install.ps1 for more details.
Thanks for your suggestion. Any idea or pull request is welcome.
Thanks for clarification. I just realised that nn
is far simpler because it does not allow local or shell specific installations. Do you want to keep it that way?
@luxferresum Do you mean manual installation? Just do the following steps:
nn
(for macOS and Linux) or nn.exe
(for Windows)~/.nn/bin
and place the binary downloaded in step 1 to this dirThe install script just did these things. It will detect the default shell, then add PATH to it. For now only zsh
and bash
are handled.
Maybe we should add a section in README for users who use other shell like fish
Thanks! Yes, documentation for manual installation would be nice.
And no, my question was about shell-specific or local node versions.
nvm has the .nvmrc, nodenv the .node-version. Both allow shell specific node versions, or even to specify a node version per folder.
This is not possible with nn
. However this seems to be the reason that nn
is so simple; it can just guarantee that ~/.nn/current
contains the right files. However with this approach you cant support local versions. So I was asking if you plan to keep it that way and not to support local versions?
It's an interesting point. Seems they dynamically change PATH
for every shell instance, while nn
just use soft link. So if you run nn use 10.8.0
, all shell instances will have 10.8.0
activated because they all point to current
soft link.
Seems Nodenv's shims is a reasonable resolution. We'll investigate pros and cons of using such a mechanism
nvm
can be quite annoying because it hooks deep into the shell. I've used nodenv so far on *nix, and I really like how transparent the functionality is. The usage of shims means I dont need any setup code that slows down my shell boot, or any hooks into my shell. I just need tonodenv rehash
when I install a new global binary the first time. This especially also makes it compatible with exotic shells like fish.I would love if
nn
could become a unified solution that would also work on windows (the one think I dont have withnodenv
).However for now its very unclear how
nn
handles switching global binaries. Does it manipulate thePATH
or does it use something like shims?