Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soft link yields nvm is not compatible with the npm config "prefix" option error. (Linux) #1800

Closed
MaineTim opened this issue Apr 30, 2018 · 2 comments

Comments

@MaineTim
Copy link

  • Operating system and version:
    Linux Mint 18.3
  • nvm debug output:
nvm --version: v0.33.9
$SHELL: /bin/bash
$SHLVL: 1
$HOME: /home/tim
$NVM_DIR: '$HOME/.nvm'
$PATH: $HOME/.opam/4.05.0/bin:$HOME/bin:$HOME/.local/bin:/usr/local/bin:/bin:/usr/bin:/opt/go/bin:/opt/flutter/bin:/opt/dart/bin
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)'
uname -a: 'Linux 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux'
OS version: Linux Mint 18.3 Sylvia  
curl: /usr/bin/curl, curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
wget: /usr/bin/wget, GNU Wget 1.17.1 built on linux-gnu.
git: /usr/bin/git, git version 2.7.4
grep: /bin/grep (grep --color=auto), grep (GNU grep) 2.25
awk: /usr/bin/awk, GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0)
sed: /bin/sed, sed (GNU sed) 4.2.2
cut: /usr/bin/cut, cut (GNU coreutils) 8.25
basename: /usr/bin/basename, basename (GNU coreutils) 8.25
rm: /bin/rm, rm (GNU coreutils) 8.25
mkdir: /bin/mkdir, mkdir (GNU coreutils) 8.25
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.7.0-git
nvm current: none
which node: 
which iojs: 
which npm: 
npm config get prefix: The program 'npm' is currently not installed. You can install it by typing:
sudo apt install npm
You will have to enable the component called 'universe'
npm root -g: The program 'npm' is currently not installed. You can install it by typing:
sudo apt install npm
You will have to enable the component called 'universe'
  • nvm ls output:
        v8.11.1
        v9.11.1
node -> stable (-> v9.11.1) (default)
stable -> 9.11 (-> v9.11.1) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> v8.11.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.1 (-> N/A)
lts/carbon -> v8.11.1
  • How did you install nvm? (e.g. install script in readme, Homebrew):
    install script.

  • What steps did you perform?

  • What happened?
    Any new shell opened or attempt to set a noide version yields the error:

 nvm is not compatible with the npm config "prefix" option: currently set to "/data/opt/nvm/versions/node/v9.11.1"
Run `nvm use --delete-prefix v9.11.1 --silent` to unset it.
  • What did you expect to happen?

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

  • If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?
The issue appears to be that the .nvm directory in my home directory is a soft link to /data/opt/nvm/. If I change
export NVM_DIR="$HOME/.nvm"

to

export NVM_DIR="/data/opt/nvm"

in .bashrc, all is well. A relatively easy fix, but surprising that nvm doesn't seem to deal well with soft links. If there are some clear rules about this and I violated them, perhaps this will document it for others if they fall into the same trap.

Addendum: I see this is also documented here: http://octopusinvitro.tk/blog/code-and-tech/how-to-install-nvm-outside-user-directory/

Thanks!

@ljharb
Copy link
Member

ljharb commented Apr 30, 2018

This is related to #617; and is more or less a duplicate of #1385.

@ljharb ljharb closed this as completed Apr 30, 2018
@ljharb
Copy link
Member

ljharb commented Apr 30, 2018

(Separately, I hope you're not using that location to share an nvm installation across multiple user accounts; each user account needs its own nvm installation and its own copies of node)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants