Nvm: unable to unalias `node` and `iojs`

Created on 4 Apr 2016  路  7Comments  路  Source: nvm-sh/nvm

Just a minor quibble, the node/iojs fracture seems to have been healed but it's not possible to remove these aliases:

$ nvm ls
         v4.4.2
->      v5.10.0
default -> stable (-> v5.10.0)
lts -> 4 (-> v4.4.2)
stable -> 5 (-> v5.10.0)
node -> stable (-> v5.10.0) (default)
iojs -> N/A (default)
$ nvm alias node
node -> stable (-> v5.10.0) (default)
$ nvm alias iojs
iojs -> N/A (default)
$ nvm unalias node
Alias node doesn't exist!
$ nvm unalias iojs
Alias iojs doesn't exist!
$ nvm --version
0.31.0
io.js

Most helpful comment

I also though I found an issue here. At least the message should be more clear and instead of "Alias iojs doesn't exist!" say "Alias iojs is a default alias and can not be removed!"

All 7 comments

That's correct, default aliases can not be removed. You can override them, but you can't eliminate them entirely.

so.. working as intended?

why does there need to be a concept of "default" aliases? If you do need to keep them around, lts and stable would be more useful default aliases to me than node and iojs

lts is a bit more complicated - see #870 for that one.

As for "stable" - everything in semver is stable, so if I removed anything, I'd remove that, and just leave node (or call it latest).

Without the default aliases for iojs and node, there'd be no way to target one flavor over the other. It may not be as useful now, but I personally still test all my modules on iojs, plus I wouldn't want to break compatibility just so nvm alias has fewer lines in it :-)

Heh, word. I dunno if anybody would really mind though, maybe consider it for your next major release version? The ecosystem changes so frequently and every users' needs are so unique, it seems like defaulting the alias system to a completely empty state and relying on the users to populate their own aliases is the only really sure way to fill everybody's needs

1080 is for a request to remove iojs - I'm going to close this for now since it's a bit broader of an issue.

Please reopen if needed!

I also though I found an issue here. At least the message should be more clear and instead of "Alias iojs doesn't exist!" say "Alias iojs is a default alias and can not be removed!"

Improving the error messages is always appreciated; if you'd like to open a PR that'd be great!

Was this page helpful?
0 / 5 - 0 ratings