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 »

tomwadley commented on 2019-02-07 22:50 (UTC) (edited on 2019-02-09 19:28 (UTC) by tomwadley)

@bobpaul thanks for the suggestion. I've made this change over on nvm-git [0]. Can you take a look and see if that works for you? If I don't hear any complaints, I'll push the same change to this package in a day or two.

[0] https://aur.archlinux.org/packages/nvm-git/

EDIT: I've pushed the change here too.

bobpaul commented on 2019-02-06 19:24 (UTC)

@tomwardley I've encountered projects that use nvm inside their own bash script. Since bash scripts don't inherit bash functions from the parent shell, these projects all expect to see nvm.sh inside $NVM_DIR. This is solved with ln -s /usr/share/nvm/nvm.sh $NVM_DIR/. Can you add that to the same script that copies nvm-exec?

FranklinYu commented on 2018-12-29 02:02 (UTC)

@Codex0 After installing, you should see your package manager prompting you to do so. If not, you should get a better package manager.

About why you need to do so, package maintainer has explained it on August 25th, 2018. Please find the corresponding comment.

Codex0 commented on 2018-12-28 14:50 (UTC)

Found that despite installing this I still had to manually execute:

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

tomwadley commented on 2018-11-04 21:50 (UTC)

@hutliver Sorry to hear it. In that case, it's not a package issue. I'd suggest seeking help from upstream. Read their readme to make sure you haven't missed something. Otherwise, they're pretty responsive to Github issues.

hutliver commented on 2018-11-04 06:11 (UTC)

@tomwadley same error :/

tomwadley commented on 2018-11-01 18:34 (UTC)

@hutliver I'm not sure what's happening here. Can you try removing this package and installing nvm the "official" upstream way with their install.sh curl|bash?

hutliver commented on 2018-11-01 15:17 (UTC)

Hi! Facing this error with the package, there's no relevant info.. bash: /usr/share/nvm/nvm.sh: line 62: syntax error near unexpected token }' bash: /usr/share/nvm/nvm.sh: line 62:}' bash: /usr/share/nvm/bash_completion: line 48: syntax error near unexpected token }' bash: /usr/share/nvm/bash_completion: line 48:}'

using termite

tomwadley commented on 2018-08-25 19:19 (UTC)

@ferrantejake The post-install instructions explain that you have to source nvm into your shell before you can use it. This is unlike typical applications which install an executable into /usr/bin which you can just call out-of-the-box. This is the way nvm is designed and its a difficult problem to work around without making sacrifices that I don't think are appropriate to force on all users of the package. For example, I believe it would be possible for this package to install something in /etc to auto source nvm for all users, but that seems quite invasive to me. With some modifications to the way nvm works though, some sort of "system nvm" which doesn't require sourcing does seem possible, and it would be interesting to explore that one day, probably as a separate package.

For now, this package includes a handy script "/usr/share/nvm/init-nvm.sh" which you can source in your .bashrc to get nvm working.

ferrantejake commented on 2018-08-25 17:02 (UTC)

Seems to not be working out-of-the-box. I ran the following (from the nvm git repo) to get the package working in the command line:

export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

Would it be possible to get this added to the PKGBUILD script?