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

oh-my-zsh: NVM is not compatible with the npm config "prefix" option #855

Open
fabdrol opened this Issue Oct 1, 2015 · 280 comments

Comments

Projects
None yet
@fabdrol

fabdrol commented Oct 1, 2015

Very annoying issue; every time I want to use node or NPM, I get this error and need to run a command to solve it.

nvm is not compatible with the npm config "prefix" option: currently set to "/Users/fabian/.nvm/versions/node/v0.12.7"
Run `nvm use --delete-prefix v0.12.7` to unset it.
@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 1, 2015

Thanks for the report! What does nvm deactivate ; nvm debug ; echo $PREFIX ; echo $NPM_CONFIG_PREFIX print out?

@fabdrol

This comment has been minimized.

fabdrol commented Oct 2, 2015

Could not find /Users/Fabian/.nvm/*/bin in $PATH
Could not find /Users/Fabian/.nvm/*/share/man in $MANPATH
$SHELL: /bin/zsh
$NVM_DIR: /Users/Fabian/.nvm
nvm current: none
which node: node not found
which iojs: iojs not found
which npm: npm not found
npm config get prefix: nvm:74: command not found: npm
npm root -g: nvm:74: command not found: npm
@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 2, 2015

and the env vars?

@fabdrol

This comment has been minimized.

fabdrol commented Oct 2, 2015

PATH=.:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/local/heroku/bin:/usr/local/mysql/bin:/usr/local/git/bin:/usr/local/mongodb/bin:/usr/bin:/usr/sbin:/usr/local/lib/AIRSDK:/usr/local/lib/AIRSDK/bin:/Users/fabian:/Users/fabian/bin:/Users/fabian/.bin:/Users/fabian/.phpdoc/bin:/Users/fabian/pear/bin:/Users/fabian/.composer/vendor/bin:/Users/fabian/android.ndk:/Users/fabian/android.sdk/r24.3.4:/Users/fabian/android.sdk/r24.3.4/tools:/Volumes/Hyper/Development/Go/bin:/Library/Java/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
TMPDIR=/var/folders/mp/hd4fy3n15z17_g9s4j11y8gm0000gn/T/
LOGNAME=fabian
XPC_FLAGS=0x0
HOME=/Users/fabian
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.WrQOEzC6ut/Render
TERM=xterm-256color
COLORFGBG=7;0
USER=fabian
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.FEGVlgCDcM/Listeners
ITERM_PROFILE=Default
TERM_PROGRAM=iTerm.app
XPC_SERVICE_NAME=0
SHELL=/bin/zsh
ITERM_SESSION_ID=w0t0p0
PWD=/Users/fabian
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
LC_CTYPE=UTF-8
SHLVL=1
OLDPWD=/Users/fabian
ZSH=/Users/fabian/.oh-my-zsh
LANG=en_US.UTF-8
GOPATH=/Volumes/Hyper/Development/Go
NODE_PATH=/usr/local/bin/node
NODE_HOME=/usr/local/lib/node
JAVA_HOME=/Library/Java/Home
ANDROID_SDK=/Users/fabian/android.sdk/r24.3.4
ANDROID_NDK=/Users/fabian/android.ndk
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:
NVM_DIR=/Users/Fabian/.nvm
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
NVM_IOJS_ORG_MIRROR=https://iojs.org/dist
MANPATH=/usr/share/man:/usr/local/share/man:/usr/local/mysql/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man
NVM_PATH=/Users/Fabian/.nvm/versions/node/v0.12.7/lib/node
NVM_BIN=/Users/Fabian/.nvm/versions/node/v0.12.7/bin
_=/usr/bin/printenv
@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 2, 2015

Thanks! so, clearly you don't have an npm prefix set.

Are you by chance using oh-my-zsh? That tends to set tons of opts that nvm has to manually account for.

@fabdrol

This comment has been minimized.

fabdrol commented Oct 2, 2015

Yeah, I am.. I could manually set it, I assume? How do I go about that?

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 2, 2015

If you try to set the "prefix" that will break nvm.

As a temporary workaround, you can do nvm use --delete-prefix v0.12.7, but this is a bug specifically with omz. I'll have to figure out which option to unset when doing the comparison.

@ljharb ljharb self-assigned this Oct 2, 2015

@ljharb ljharb changed the title from NVM is not compatible with the npm config "prefix" option to oh-my-zsh: NVM is not compatible with the npm config "prefix" option Oct 2, 2015

@fabdrol

This comment has been minimized.

fabdrol commented Oct 2, 2015

Okay, let me know if I can help with anything!

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 2, 2015

Could you provide the output of setopt as well? From there I should be able to try to debug it.

@fabdrol

This comment has been minimized.

fabdrol commented Oct 2, 2015

alwaystoend
autocd
autopushd
cdablevars
completeinword
extendedhistory
noflowcontrol
histexpiredupsfirst
histignoredups
histignorespace
histverify
incappendhistory
interactive
interactivecomments
login
longlistjobs
nonomatch
promptsubst
pushdignoredups
pushdminus
sharehistory
shinstdin
@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 2, 2015

Thanks! I'll take a look at this asap.

@fabdrol

This comment has been minimized.

fabdrol commented Oct 2, 2015

One more thing that could be interesting: this is a brand new installation of El Capitan; I didn't have this issue before on Mavericks (I also used oh my zsh on Mavericks)

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 2, 2015

Good to know - I don't have an El Capitan machine to test on just yet.

@ljharb ljharb added the OS: Mac OS label Oct 2, 2015

@fabdrol

This comment has been minimized.

fabdrol commented Oct 2, 2015

If you have anything else I should test for you, just let me know.

@mikepaggi

This comment has been minimized.

mikepaggi commented Oct 5, 2015

I definitely started noticing these issues after upgrading to El Capitan.

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 5, 2015

@mikepaggi you're also on zsh? are you using oh-my-zsh?

kpdecker added a commit to kpdecker/six-speed that referenced this issue Oct 6, 2015

@rudeayelo

This comment has been minimized.

rudeayelo commented Oct 7, 2015

I'm also getting this issue on Yosemite:

nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local/Cellar/nvm/0.27.1/versions/node/v4.1.1"
Run `nvm use --delete-prefix v4.1.1 --silent` to unset it.

Once I run nvm use --delete-prefix v4.1.1 --silent it starts working normally, but I have to do it every time I open a new session.

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 7, 2015

@rudeworks nvm is utterly unsupported on homebrew - please brew uninstall that, and install using the proper curl command in the readme, and see if you're still having issues?

@ckiss

This comment has been minimized.

ckiss commented Oct 7, 2015

I get the same error on Yosemite:
nvm is not compatible with the npm config "prefix" option: currently set to "/Users/cristik/.nvm/v0.10.38" Runnpm config delete prefixornvm use --delete-prefix v0.10.38 --silentto unset it.
and I installed using the curl command in readme.

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 7, 2015

@ckiss thanks - also on zsh?

@jaromero

This comment has been minimized.

jaromero commented Oct 7, 2015

FWIW I'm also getting this on Arch Linux also with zsh, with nvm installed both via curl and by manually cloning and sourcing nvm.sh in my .zshrc.

I hadn't updated nvm in a while, but I did just notice that the last 'good' tag (i.e. no error shown) was v0.26.1. I'll see if I can find the actual commit where this begins.

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 7, 2015

Thanks - I'm quite certain it's simply the commit where I added this check, which suggests that the check doesn't work properly in zsh. @jaromero, can you also confirm whether you are or are not using oh-my-zsh?

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Jul 18, 2018

@tolerious because you have a prefix line in ~./npmrc. Delete it.

@tolerious

This comment has been minimized.

tolerious commented Jul 18, 2018

@ljharb I set prefix to avoid permission issue related to this post

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Jul 19, 2018

That issue doesn't apply when using nvm, so no prefix is needed. Either way, regardless of npm's advice, setting the prefix isn't a good idea.

@rifler

This comment has been minimized.

rifler commented Jul 20, 2018

I realised, that this behaviour connected with commitizen
when I simply run git commit -am "msg" - all hooks run fine
when I run git-cz - I get

nvm is not compatible with the "npm_config_prefix" environment variable: currently set to "/Users/rifler/.nvm/versions/node/v10.6.0"
Run `unset npm_config_prefix` to unset it.
husky > can't find npm in PATH, skipping precommit script in package.json
nvm is not compatible with the "npm_config_prefix" environment variable: currently set to "/Users/rifler/.nvm/versions/node/v10.6.0"

upd:
it is connected with husky package too, so updating to husky@next solved my problem

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Jul 20, 2018

@rifler looks like you commented on another issue, and this reply addresses it

@shinokada

This comment has been minimized.

shinokada commented Aug 1, 2018

This code fixed for me.

In my .zshrc

export NVM_DIR="${XDG_CONFIG_HOME/:-$HOME/.}nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
@ljharb

This comment was marked as outdated.

Collaborator

ljharb commented Aug 4, 2018

@Xiongqi-XQ nvm doesn't support traversing symlinks, so that's not going to work well, and is poor advice. global modules should truly live inside NVM_DIR. I'm going to hide both our comments so it's harder for people to accidentally implement your suggestion.

@ceccode

This comment has been minimized.

ceccode commented Aug 5, 2018

I am on a mac v10.13.16, i am using oh-my-zsh.
It work on Terminal as well as iTerm, but the problem persist with Tmux

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Aug 5, 2018

@ceccode i suspect that’s a different problem, related to the files tmux is sourcing. Can you file a separate issue?

@jcollum

This comment has been minimized.

jcollum commented Aug 14, 2018

Worth noting that @ADiesel82's solution worked for me #855 (comment)

I'm commenting here because it's very difficult to find fixes in github threads. The thumbsup system is lacking.

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Aug 14, 2018

@jcollum that very info is in the readme; i'd suggest starting there before trying to find fixes in github threads :-)

@sindhus

This comment has been minimized.

sindhus commented Aug 20, 2018

Using Zsh with oh-my-zsh and this issue of

Run `npm config delete prefix` or `nvm use --delete-prefix v10.8.0 --silent` to unset it.

still persists. Even with nvm use --delete-prefix v10.8.0 --silent in the .zshrc file, i still get the message every time I open a terminal. Very annoying. How do I fix it?

@zlq4863947

This comment has been minimized.

zlq4863947 commented Aug 23, 2018

just nvm use node

@maevadevs

This comment has been minimized.

maevadevs commented Aug 27, 2018

@reallistic explains the root cause of this behavior above, and a great solution. I also noticed that when you run brew update && brew upgrade it might reinstall brew's version of node depending on the dependency tree (which looks like yarn is the main culprit), even when you are already using nvm's node. This brings back the conflict after already using @reallistic's solution. When that happens, just re-do the fix steps. Just fyi.

@fugroup

This comment has been minimized.

fugroup commented Aug 30, 2018

brew uninstall --ignore-dependencies node solved it for me as I had an old version of node lying around.

@SkeLLLa

This comment has been minimized.

SkeLLLa commented Oct 18, 2018

The same on linux.

Even if prefix is set to something like ~/.npm-global issue is present. (it also present if there's no prefixes at all)

Also if I use "recommended" nvm use --delete-prefix v10.12.0 then nvm sets node to current version installed, but running it will end with segmentation fault (core dumped), however running it by the full path like /home/user/.nvm/versions/node/v10.12.0/bin/node works well.

PS: there's no system nodejs version installed. only nvm.

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 19, 2018

@SkeLLLa certainly you don't want to ever use "prefix"; the segfault seems like a serious issue (note that node 10 no longer supports 32 bit machines on linux), altho that'd be coming from npm not from node.

@SkeLLLa

This comment has been minimized.

SkeLLLa commented Oct 19, 2018

@ljharb I've resolved issue with segfaults. The problem was that if node is launched like node not with full path it take wrong so files and got segfault.

As for prefix issue - I've just tried to add it in order to try to resolve issue. I never set it before installing nvm. So it was installed on clean system with zsh. And when I tried to switch node version to one that I've installed it promted about prefix.

I've tried to delete that prefix with npm config and that didn't work. Later I tried to manually set it in .npmrc and that also not resolved this issue.

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 19, 2018

node by itself should be sufficient; if that doesn't work, what does which node print out?

@SkeLLLa

This comment has been minimized.

SkeLLLa commented Oct 19, 2018

@ljharb it will print /home/user/.nvm/versions/node/v10.12.0 and as I said if I use just node it will tried to load some .so libs from /usr directory. I think because on linux it's default path for libs and node searches dynamic libs there by default. That was the problem.

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Oct 19, 2018

hm, that doesn't make much sense to me; if which node is an nvm-installed node, then node should work, with or without the full path.

@dbrw

This comment has been minimized.

dbrw commented Nov 5, 2018

I also got this error when using prezto. I uninstalled system node and the error does not appear again.

[EDIT:]
:) For now I migrate to nodenv.

tmsh added a commit to tmsh/myzsh that referenced this issue Nov 10, 2018

@donaral

This comment was marked as resolved.

donaral commented Nov 13, 2018

Hi @ljharb I have the same issue and I'm not sure which fix steps to follow. Could you please help?
thanks.

Could not find /Users/donaral/.nvm/*/bin in $PATH
nvm --version: v0.33.11
$TERM_PROGRAM: iTerm.app
$SHELL: /bin/zsh
$SHLVL: 1
$HOME: /Users/donaral
$NVM_DIR: '$HOME/.nvm'
$PATH: $HOME/.rvm/gems/ruby-2.4.1/bin:$HOME/.rvm/gems/ruby-2.4.1@global/bin:$HOME/.rvm/rubies/ruby-2.4.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/.rbenv/shims:$HOME/Library/android-sdk/tools:$HOME/Library/android-sdk/platform-tools:$HOME/.rvm/gems/ruby-2.4.1/bin:$HOME/.rvm/gems/ruby-2.4.1@global/bin:$HOME/.rvm/rubies/ruby-2.4.1/bin:$HOME/.rvm/bin:$HOME/Library/Android/sdk/tools:$HOME/Library/Android/sdk/platform-tools:$HOME/.rvm/bin
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.3 (x86_64-apple-darwin17.0)'
uname -a: 'Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64'
OS version: Mac 10.13.6 17G65
curl: /usr/bin/curl, curl 7.54.0 (x86_64-apple-darwin17.0) libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
wget: not found
git: /usr/bin/git, git version 2.15.2 (Apple Git-101.1)
grep: grep: aliased to grep  --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn} (grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}), grep (BSD grep) 2.5.1-FreeBSD
awk: /usr/bin/awk, awk version 20070501
sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: /usr/bin/sed,
cut: illegal option -- -
usage: cut -b list [-n] [file ...]
       cut -c list [file ...]
       cut -f list [-s] [-d delim] [file ...]
cut: /usr/bin/cut,
basename: illegal option -- -
usage: basename string [suffix]
       basename [-a] [-s suffix] string [...]
basename: /usr/bin/basename,
rm: illegal option -- -
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file
rm: /bin/rm,
mkdir: illegal option -- -
usage: mkdir [-pv] [-m mode] directory ...
mkdir: /bin/mkdir,
xargs: illegal option -- -
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
             [-L number] [-n number [-x]] [-P maxprocs] [-s size]
             [utility [argument ...]]
xargs: /usr/bin/xargs,
nvm current: system
which node: /usr/local/bin/node
which iojs: iojs not found
which npm: /usr/local/bin/npm
npm config get prefix: /usr/local
npm root -g: /usr/local/lib/node_modules```

env

```TERM_SESSION_ID=w0t0p0:87954B49-8844-40A2-80CC-942319E7CCDF
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.NXLb2K9P76/Listeners
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.Kt9G9Sskzo/Render
COLORFGBG=7;0
ITERM_PROFILE=Default
XPC_FLAGS=0x0
LANG=tr_TR.UTF-8
PWD=/Users/donaral
SHELL=/bin/zsh
SECURITYSESSIONID=186a8
TERM_PROGRAM_VERSION=3.2.5
TERM_PROGRAM=iTerm.app
PATH=/Users/donaral/.rvm/gems/ruby-2.4.1/bin:/Users/donaral/.rvm/gems/ruby-2.4.1@global/bin:/Users/donaral/.rvm/rubies/ruby-2.4.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/donaral/.rbenv/shims:/Users/donaral/Library/android-sdk/tools:/Users/donaral/Library/android-sdk/platform-tools:/Users/donaral/.rvm/gems/ruby-2.4.1/bin:/Users/donaral/.rvm/gems/ruby-2.4.1@global/bin:/Users/donaral/.rvm/rubies/ruby-2.4.1/bin:/Users/donaral/.rvm/bin:/Users/donaral/Library/Android/sdk/tools:/Users/donaral/Library/Android/sdk/platform-tools:/Users/donaral/.rvm/bin
COLORTERM=truecolor
COMMAND_MODE=unix2003
TERM=xterm-256color
HOME=/Users/donaral
TMPDIR=/var/folders/64/r3kkflld5yx190dx8_zc037h0000gp/T/
USER=donaral
XPC_SERVICE_NAME=0
LOGNAME=donaral
__CF_USER_TEXT_ENCODING=0x1F6:0x0:0x0
ITERM_SESSION_ID=w0t0p0:87954B49-8844-40A2-80CC-942319E7CCDF
SHLVL=1
OLDPWD=/Users/donaral
ZSH=/Users/donaral/.oh-my-zsh
PAGER=less
LESS=-R
LC_CTYPE=tr_TR.UTF-8
LSCOLORS=Gxfxcxdxbxegedabagacad
VIRTUAL_ENV_DISABLE_PROMPT=1
NVM_DIR=/Users/donaral/.nvm
NVM_CD_FLAGS=-q
rvm_prefix=/Users/donaral
rvm_path=/Users/donaral/.rvm
rvm_bin_path=/Users/donaral/.rvm/bin
rvm_version=1.29.3 (latest)
GEM_HOME=/Users/donaral/.rvm/gems/ruby-2.4.1
GEM_PATH=/Users/donaral/.rvm/gems/ruby-2.4.1:/Users/donaral/.rvm/gems/ruby-2.4.1@global
MY_RUBY_HOME=/Users/donaral/.rvm/rubies/ruby-2.4.1
IRBRC=/Users/donaral/.rvm/rubies/ruby-2.4.1/.irbrc
RUBY_VERSION=ruby-2.4.1
ANDROID_HOME=/Users/donaral/Library/android-sdk
JAVA_HOME=/usr/bin
RBENV_SHELL=zsh
rvm_alias_expanded=
rvm_bin_flag=
rvm_docs_type=
rvm_gemstone_package_file=
rvm_gemstone_url=
rvm_niceness=
rvm_nightly_flag=
rvm_only_path_flag=
rvm_pretty_print_flag=
rvm_proxy=
rvm_quiet_flag=
rvm_ruby_bits=
rvm_ruby_file=
rvm_ruby_make=
rvm_ruby_make_install=
rvm_ruby_mode=
rvm_script_name=
rvm_sdk=
rvm_silent_flag=
rvm_use_flag=
rvm_wrapper_name=
LS_COLORS=di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:
GREP_COLOR=1;33
rvm_hook=
_system_type=Darwin
_system_name=OSX
_system_version=10.13
_system_arch=x86_64
_=/usr/bin/env```
@ljharb

This comment was marked as resolved.

Collaborator

ljharb commented Nov 13, 2018

@donaral try removing your system node

@donaral

This comment was marked as resolved.

donaral commented Nov 13, 2018

@ljharb thanks, that worked!

@HermitCarb

This comment has been minimized.

HermitCarb commented Nov 17, 2018

Just add a line before export NVM_DIR="$HOME/.nvm", like this:

# nvm
unset npm_config_prefix # Add this line
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

It works for me, but don't know why.

@ljharb

This comment has been minimized.

Collaborator

ljharb commented Nov 17, 2018

@HermitCarb that works for you because you have the “npm_config_prefix” environment variable set somehow - something else in your profile is setting it. Your fix works, but a better one would find and remove the place that sets it, rather than setting it and then unsettling it.

@jxycbjhc

This comment has been minimized.

jxycbjhc commented Dec 8, 2018

brew uninstall --ignore-dependencies node solved it for me as I had an old version of node lying around.

it works for me thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment