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.73
First Submitted: 2015-03-14 21:57 (UTC)
Last Updated: 2024-08-27 22:35 (UTC)

Dependencies (1)

Required by (492)

Sources (3)

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 »

Nowaker commented on 2020-09-04 18:38 (UTC)

How do I use nvm these days? In the past, this package exposed nvm command I could freely use.

tomwadley commented on 2020-02-09 22:20 (UTC)

@FranklinYu The reason I kept them separate is because install-nvm-exec feel a little more "controversial" to me. I can imagine some people explicitly not wanting install-nvm-exec to run as it modifies your home directory... (not much mind you - it just creates ~/.nvm and puts some symlinks there)

But you're right that if users want to avoid install-nvm-exec they would also be avoiding init-nvm.sh as well.... so maybe keeping them separate is silly.

But the need to do that really highlights the way in which nvm was not designed to be packaged via a system package manager like pacman. The "official" way to install it is via their install.sh script which makes way more drastic changes to your home directory! (edits ~/.bashrc etc.)

FranklinYu commented on 2020-02-06 07:29 (UTC)

Do you think it makes sense to merge install-nvm-exec into init-nvm.sh? Both scripts are very short.

tomwadley commented on 2019-09-22 15:04 (UTC)

Thanks for the heads-up @donsmith - I've updated the url.

donsmith commented on 2019-09-22 04:38 (UTC)

@tomwadley, just a heads-up for your next update. The nvm repo has moved to https://github.com/nvm-sh/nvm. Obviously this has not broken this package - just letting you know.

I was confused about it until I went back in the commits and verified that the same repo used to belong to Tim (creationx) and has been removed from its old location.

tomwadley commented on 2019-03-25 13:37 (UTC)

Thanks for the tip @jamespharvey20. I wasn't aware of SRCDEST. Fixed.

jamespharvey20 commented on 2019-03-25 09:06 (UTC)

Downloaded source filenames must be unique, for those who set SRCDEST in /etc/makepkg.conf. See https://wiki.archlinux.org/index.php/PKGBUILD#source

Please add something like this to the beginning of source:

source=("${pkgname}-${pkgver}.zip::https...

tomwadley commented on 2019-03-17 17:53 (UTC)

@joshsteele21 You shouldn't have to change any permissions or use sudo. And you're sourcing (as opposed to executing) init-nvm.sh right? Have you previously tried to install nvm the "official" way from their readme? There could be some sort of conflict going on there.

jost21 commented on 2019-03-08 02:26 (UTC) (edited on 2019-03-08 17:50 (UTC) by jost21)

Installation and running the init-nvm.sh script works fine, but running nvm install node does not work because of permission denied errors. Using sudo does not recognize the nvm command (sudo: nvm: command not found)

EDIT: Do I need to manually change the permissions on /usr/share/nvm ?

FranklinYu commented on 2019-02-10 16:55 (UTC) (edited on 2019-02-10 22:18 (UTC) by FranklinYu)

@bobpaul Actually NVM is not designed to be used in script, IIUC. Please notify those project owners that nvm-exec is the correct tool for non-interactive use. Or is there any example for us to have a look?

EDIT: please forgive my innocence and ignore the comment above. Official suggestion is to use nvm exec which expects nvm.sh to be in $NVM_DIR.