Package Details: nvm 0.39.7-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: 284
Popularity: 6.31
First Submitted: 2015-03-14 21:57 (UTC)
Last Updated: 2023-12-06 07:03 (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

1 2 3 4 5 6 .. 8 Next › Last »

tomwadley commented on 2023-12-05 15:06 (UTC) (edited on 2023-12-06 07:07 (UTC) by tomwadley)

I've reverted back to 0.39.5 for now due to the zsh issue

EDIT: This issue has been resolved

tomwadley commented on 2023-12-05 14:33 (UTC)

@llevkin From what I can tell, this is an upstream issue: https://github.com/nvm-sh/nvm/issues/3247

I can reproduce it with upstream's installer (once I've actually installed a node version into the new nvm) so I'm pretty sure its not the package's fault.

llevkin commented on 2023-12-05 13:32 (UTC)

I have received "nvm:867: command not found: hash" message any time then I opened new zsh shell. It's started after update to version 0.39.6-1.

lordxan commented on 2023-04-04 18:44 (UTC) (edited on 2023-04-04 18:55 (UTC) by lordxan)

After installing this package and sourcing init-nvm.sh i having this issue manpath: can't set the locale; make sure $LC_* and $LANG are correct

Update: forgot to generate locale for LC_TIME :p

tomwadley commented on 2022-11-09 23:41 (UTC)

@amatos are you using the fish shell? nvm doesn't support fish. See the notes in the upstream readme. But there are some alternatives/workarounds listed there too and some of those also appear to be in the AUR.

amatos commented on 2022-11-09 21:36 (UTC) (edited on 2022-11-09 21:37 (UTC) by amatos)

I get this error when running source:

source /usr/share/nvm/init-nvm.sh                                                                                                                                                                                                                                       ─╯
/usr/share/nvm/nvm.sh (line 381): Unexpected ')' found, expecting '}'
    *[!/]*/)
           ^
from sourcing file /usr/share/nvm/nvm.sh
    called on line 2 of file /usr/share/nvm/init-nvm.sh
from sourcing file /usr/share/nvm/init-nvm.sh
source: Error while reading file '/usr/share/nvm/nvm.sh'
/usr/share/nvm/bash_completion (line 5): Missing end to balance this if statement
if ! command -v nvm &> /dev/null; then
^
from sourcing file /usr/share/nvm/bash_completion
    called on line 3 of file /usr/share/nvm/init-nvm.sh
from sourcing file /usr/share/nvm/init-nvm.sh
source: Error while reading file '/usr/share/nvm/bash_completion'

tomwadley commented on 2022-07-04 16:24 (UTC) (edited on 2022-07-04 16:31 (UTC) by tomwadley)

@tukusejssirs as I replied to @meijin, this package doesn't create those files. In fact, the entire purpose of nvm is to not pollute your system node installation. With nvm you install a local version of node and npm, with a local node_modules for "globally" installed packages.

If for example I install a package globally:

nvm use 16 # Now using node v16.14.0
npm install -g pm2

It will install into my local node's node_modules. For me that is: ~/.nvm/versions/node/v16.14.0/lib/node_modules/pm2/. nvm also put this on my PATH so I have access to the global pm2 binary (and for that matter the npm and node binaries themselves): ~/.nvm/versions/node/v16.14.0/bin.

tukusejssirs commented on 2022-07-04 11:49 (UTC)

I experienced same conflict as @meijin has described in his comment, at least twice in the past month (I think it occurred every time npm package installed via pacman was updated).

The error from pacman -S npm (run via yay -S npm) I had today was:

error: failed to commit transaction (conflicting files)
npm: /usr/lib/node_modules/npm/lib/package-url-cmd.js exists in filesystem
npm: /usr/lib/node_modules/npm/lib/utils/format-search-stream.js exists in filesystem
Errors occurred, no packages were upgraded.
 -> error installing repo packages

I worked this issue around simply renaming /usr/lib/node_modules, installing npm and restoring globally installed NPM packages:

# Move old global `node_modules`
sudo mv /usr/lib/node_modules{,.bak}

# Reinstall system `npm`
yay -S npm

# Remove packages installed by `npm` system package
sudo rm -rf /usr/lib/node_modules.bak/{node-gyp,nopt,npm}

# Move previously globally installed NPM packages into newly installed global `node_modules`
sudo mv /usr/lib/node_modules.bak/* /usr/lib/node_modules

# Remove old global `node_modules`
sudo rmdir /usr/lib/node_modules.bak

I hope this issue will be solved, however, I have no idea why it happens in the first place.

andradei commented on 2022-01-14 00:31 (UTC) (edited on 2022-01-14 00:56 (UTC) by andradei)

Solution to issue below:

The package is fine. My config was the problem.

I'm using zsh as my shell and had the line source /usr/share/nvm/init-nvm.sh in my .zshenv. Moving it to .zshrc fixed it.

Looks like my distro sources .zshenv on every keybinding I press. I don't know...


Issue

Beginner in arch here. I installed the EndeavorOS bspwm (community) edition and it works perfectly until I install this package.

This is how I installed it:

yay -S --noconfirm nvm
source /usr/share/nvm/init-nvm.sh
nvm install node

and all of a sudden all of my keybindings take 1-2 seconds to register, as opposed to instantly.

I went so far as to reinstall the distro and install each package I use and reboot the system (I know it's overkill) until I found what was slowing it down.

After finding out, removing this package with yay -Rusn nvm "fixed" the problem.