lukechilds / zsh-nvm

Zsh plugin for installing, updating and loading nvm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make npm prefix working

weilbith opened this issue · comments

I have the following npm configuration to make it conform with the XDG basedir specification:

prefix=${XDG_DATA_HOME}/npm
cache=${XDG_CACHE_HOME}/npm
tmp=${XDG_RUNTIME_DIR}/npm
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js

I set the $NPM_CONFIG_USERCONFIG environment variable to $XDG_CONFIG_HOME/npm/npmrc to load the above content. Furthermore I set $NVM_DIR to $XDG_DATA_HOME/nvm.

I get some errors for nvm use (enabled $NVM_AUTO_USE). I think the reason becomes clear when I call nvm install v12. Which brings the following output:

v12.16.3 is already installed.
nvm is not compatible with the npm config "prefix" option: currently set to "/home/thore/.local/share/npm"
Run `npm config delete prefix` or `nvm use --delete-prefix v12.16.3` to unset it.

I'm not sure what the suggested solutions do in detail. I really want to keep my documentation. Is this possible?

It doesn't look like this issue is related to zsh-nvm.

Is there a reason you think it is?

You mean I should direct it to nvm directly?

Yeah, unless you think there's it's something that zsh-nvm is doing that's causing the issue.