Nvm: Trouble using NVM as non-root user

Created on 10 Sep 2018  路  8Comments  路  Source: nvm-sh/nvm

  • Operating system and version:
    CentOS 7.5.1804
  • nvm debug output:

nvm --version: v0.33.11
$SHELL: /usr/local/cpanel/bin/jailshell
$SHLVL: 1
$HOME: /home/squak
$NVM_DIR: '$HOME/.nvm'
$PATH: $NVM_DIR/versions/node/v8.9.4/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/lib64/qt-3.3/bin:$HOME/perl5/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin:/opt/cpanel/composer/bin:/usr/local/bin:/usr/X11R6/bin:$HOME/.local/bin:$HOME/bin
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)'
uname -a: 'Linux 3.10.0-042stab130.1 #1 SMP Tue May 22 09:19:34 MSK 2018 x86_64 x86_64 x86_64 GNU/Linux'
curl: /bin/curl, curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.34 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
wget: /bin/wget, GNU Wget 1.14 built on linux-gnu.
git: /usr/local/cpanel/3rdparty/lib/path-bin/git, git version 2.18.0
grep:  (grep --color=auto), grep (GNU grep) 2.20
awk: /bin/awk, GNU Awk 4.0.2
sed: /bin/sed, sed (GNU sed) 4.2.2
cut: /bin/cut, cut (GNU coreutils) 8.22
basename: /bin/basename, basename (GNU coreutils) 8.22
rm:  (rm -i), rm (GNU coreutils) 8.22
mkdir: /bin/mkdir, mkdir (GNU coreutils) 8.22
xargs: /bin/xargs, xargs (GNU findutils) 4.5.11
nvm current: v8.9.4
which node: $NVM_DIR/versions/node/v8.9.4/bin/node
which iojs: which: no iojs in ($NVM_DIR/versions/node/v8.9.4/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/lib64/qt-3.3/bin:$HOME/perl5/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin:/opt/cpanel/composer/bin:/usr/local/bin:/usr/X11R6/bin:$HOME/.local/bin:$HOME/bin)
which npm: $NVM_DIR/versions/node/v8.9.4/bin/npm
npm config get prefix:
npm root -g:

  • nvm ls output:

->       v8.9.4
default -> node (-> v8.9.4)
node -> stable (-> v8.9.4) (default)
stable -> 8.9 (-> v8.9.4) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.4 (-> N/A)
lts/carbon -> v8.11.4 (-> N/A)

  • How did you install nvm? (e.g. install script in readme, Homebrew):
    install script in readme using curl

  • What steps did you perform?

nvm install 8.9.4
  • What happened?
manpath: can't open the manpath configuration file /etc/man_db.conf
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run nvm use --delete-prefix v8.9.4 to unset it.
  • What did you expect to happen?
    I expected it to be installed properly to allow for node usage on SSH for other cPanel accounts that don't have access to root

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?
    Only what NVM put there

root / multiuser issues

Most helpful comment

I'm aware, installing it as root it works fine, however when I install it as another user who does not have root permissions, I get that error.

All 8 comments

nvm is per-user - each user account needs its own copy of nvm.

I'm aware, installing it as root it works fine, however when I install it as another user who does not have root permissions, I get that error.

Again, nvm can鈥檛 be shared across users - you shouldn鈥檛 install it as root at all, and each user should get their own distinct copy of nvm.

Sorry for the misunderstanding,
I've uninstalled it from the root user, and then installed under another user, and it seemed to work.
So I logged into the user that was having trouble, and uninstalled then reinstalled, and on first glance it seemed to work. Should the situation change I'll update here

I still however get the manpage error, which pops up everytime I login (to a non-root user) after installing NVM.

I checked the permissions of the man_db file and it's 644, so I don't know the issue there.

stat -c "%a %n" /etc/man_db.conf
644 /etc/man_db.conf

I get the same issue whenever I type man or manpage

Thanks; the manpage error seems legitimate.

nvm, when changing versions, updates MANPATH - what happens if you call manpath prior to installing nvm?

Calling manpath on a user that has not yet installed nvm get's the following:

manpath
/usr/share/man:/usr/local/man:/usr/local/share/man

Any updates to this? I'm still unable to use man on any account that has installed NVM

Sorry for the delay.

This line: https://github.com/creationix/nvm/blob/master/nvm.sh#L2839 strips /share/man from MANPATH on nvm deactivate.

This line: https://github.com/creationix/nvm/blob/master/nvm.sh#L2944 changes /share/man to the nvm version dir, and sets it as $MANPATH.

I'm not sure why this would be causing the issues you're seeing.

Was this page helpful?
0 / 5 - 0 ratings