Skip to content

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

Closed
@fabdrol

Description

@fabdrol

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.

Activity

ljharb

ljharb commented on Oct 1, 2015

@ljharb
Member

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

added
needs followupWe need some info or action from whoever filed this issue/PR.
on Oct 1, 2015
fabdrol

fabdrol commented on Oct 2, 2015

@fabdrol
Author
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

ljharb commented on Oct 2, 2015

@ljharb
Member

and the env vars?

fabdrol

fabdrol commented on Oct 2, 2015

@fabdrol
Author
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

ljharb commented on Oct 2, 2015

@ljharb
Member

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

fabdrol commented on Oct 2, 2015

@fabdrol
Author

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

ljharb

ljharb commented on Oct 2, 2015

@ljharb
Member

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.

added
bugsOh no, something's broken :-(
and removed
needs followupWe need some info or action from whoever filed this issue/PR.
on Oct 2, 2015
self-assigned this
on Oct 2, 2015
changed the title [-]NVM is not compatible with the npm config "prefix" option[/-] [+]oh-my-zsh: NVM is not compatible with the npm config "prefix" option[/+] on Oct 2, 2015
fabdrol

fabdrol commented on Oct 2, 2015

@fabdrol
Author

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

ljharb

ljharb commented on Oct 2, 2015

@ljharb
Member

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

366 remaining items

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @heycarsten@bryansray@reybango@pdeka@eldoy

      Issue actions

        oh-my-zsh: NVM is not compatible with the npm config "prefix" option · Issue #855 · nvm-sh/nvm