Package Details: nvm 0.40.1-1

Git Clone URL: https://aur.archlinux.org/nvm.git (read-only, click to copy)
Package Base: nvm
Description: Node Version Manager - Simple bash script to manage multiple active node.js versions
Upstream URL: https://github.com/nvm-sh/nvm
Licenses: MIT
Submitter: tomwadley
Maintainer: tomwadley
Last Packager: tomwadley
Votes: 298
Popularity: 5.85
First Submitted: 2015-03-14 21:57 (UTC)
Last Updated: 2024-08-27 22:35 (UTC)

Pinned Comments

tomwadley commented on 2020-09-04 22:14 (UTC) (edited on 2020-09-04 22:15 (UTC) by tomwadley)

Due to the way nvm is designed, you have to source it before you can use it:

source /usr/share/nvm/init-nvm.sh

You will probably want that in your shell startup file, e.g.:

echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc

See nvm.install or the upstream README for more details.

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 Next › Last »

givemeurhats commented on 2018-01-19 01:36 (UTC)

Check out https://aur.archlinux.org/packages/nodejs-fake/ which takes care so packages like npm don't install nodejs as their dependency, keeping nvm the only source of nodejs on the system.

ljharb commented on 2017-06-01 22:05 (UTC)

@tomwadley Makes sense. I still think nvm itself should be stored in the home directory, but as long as it works, that's fine. The reality, of course, is that without a second factor on a separate communications channel, the system package manager isn't any more secure than curl | sh :-) no need to get into the "security theater" argument here, of course. My hope is that this AUR approach won't be like every other attempt before it to package nvm via an unsupported method; but that instead, this one will actually *work* and not cause bugs. So far, there's been few complaints, so congrats!

tomwadley commented on 2017-06-01 18:28 (UTC)

Hi @ljharb, Firstly, thanks for dropping in and for all of your work on nvm. I (and I'm sure everyone using this package) really appreciates everything you're doing. To answer your question, if the user follows the instructions, NVM_DIR *is* actually set to $HOME/.nvm. It's only that nvm itself is put in /usr/share. To elaborate a little more, this package is for people, like me, who prefer to have all of their installed software managed by their system package manager rather than installing things with a curl-pipe-bash. A lot of people also prefer not to have a script (such as your install.sh) making changes directly to files in their home directory. The philosophy behind install.sh doesn't sit well with me and I wanted to be able to install nvm without using it. Of course, the fundamental design of nvm is that its a sourced shell function which makes it difficult to package as though it were a normal system executable. It is unfortunate that even with this AUR package, users must still edit their personal .bashrc files. But if this is necessary, I believe Arch users would prefer to do that by hand.

ljharb commented on 2017-06-01 06:40 (UTC)

Hi, http://nvm.sh / https://github.com/creationix/nvm/ maintainer here. @lwin please file an issue on the upstream repo; slowness is generally due to `npm config get prefix` being slow. @lacrymology you're using an old/never worked properly `nvm` that was incorrectly installed from `npm`. `npm uninstall -g nvm`, and then please reinstall it properly (from the install script, or this AUR package). @rulatir nvm is a sourced shell function - there is no binary, no executable. When you source `nvm.sh`, you'll get an `nvm` function available in your shell. @tomwadley is there a particular reason that this installs $NVM_DIR to a non-user-specific place? nvm is per-user, and should not be shared across user accounts. In general to everyone, please start by filing an issue on the git repo directly - https://github.com/creationix/nvm/issues/new - and please call out you're installing it via this AUR package. If it's a packaging problem, I'll point you back here. Thanks!

tomwadley commented on 2017-01-18 23:11 (UTC)

@lwin I believe this is an upstream issue and not related to the packaging although I'd be happy to be proven wrong. It's also slow for me. There are various issues on github complaining about slow loading. Let me know if you figure anything out.

lwin commented on 2017-01-18 22:50 (UTC)

The rule "source /usr/share/nvm/init-nvm.sh" at the end of my ~/.bashrc makes the load (start) of my terminal (urxvt) noteworthy slow. Is there a simple solution for this?

tomwadley commented on 2016-08-28 21:25 (UTC)

@Nowaker My intention was that you wouldn't use the convenience script init-nvm if you wanted customizations. But you're right, there's no reason for it to set NVM_DIR if it's already set. I've pushed a fix for this.

Nowaker commented on 2016-08-28 06:08 (UTC)

/usr/share/nvm/init-nvm.sh shouldn't override $NVM_DIR if one already exists.

tomwadley commented on 2016-06-25 12:09 (UTC)

Good call @gat. I've updated the postinstall message to say .zshrc instead of .zprofile.

gat commented on 2016-06-25 10:46 (UTC)

Question. Shouldn't the postinstall message echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.zprofile have .zshrc instead of .zprofile? The latter doesn't seem to work and for bash it's .bashrc instead of .profile for Bash.