-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
nvm install fails complaining about prefix, despite not being set #1087
Comments
I installed node globally on my system, hoping it would fix my issue. Alas, it did not, so I proceeded to figure out what the npm config looks like: $ npm config get prefix
/usr This appears to be some sort of default, as it is not in the env, my npmrc or anywhere else I control. Since the above description assumes that node/npm isn't installed prior to |
I was running on the |
What does How did you install your system node? What happens if you run |
I installed node via nodesource $ nvm debug
nvm --version: v0.31.0
$SHELL: /bin/bash
$HOME: /home/dominic
$NVM_DIR: '$HOME/.dotfiles/nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
nvm current: system
which node: /usr/bin/node
which iojs:
which npm: /usr/bin/npm
npm config get prefix: /usr
npm root -g: /usr/lib/node_modules However, my original intent was to do w/o the global node, so when I uninstall and re-run nvm debug: $ nvm debug
nvm --version: v0.31.0
$SHELL: /bin/bash
$HOME: /home/dominic
$NVM_DIR: '$HOME/.dotfiles/nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
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-get install npm
npm root -g: The program 'npm' is currently not installed. You can install it by typing:
sudo apt-get install npm And as for those other steps: $ nvm install 6
Downloading https://nodejs.org/dist/v6.1.0/node-v6.1.0-linux-x64.tar.xz...
######################################################################## 100.0%
nvm is not compatible with the npm config "prefix" option: currently set to "/home/dominic/Github/dominicbarnes/dotfiles/nvm/versions/node/v6.1.0"
Run `nvm use --delete-prefix v6.1.0` to unset it.
$ nvm use --delete-prefix v6.1.0
Now using node v6.1.0 (npm v3.8.6)
$ which npm
/home/dominic/.dotfiles/nvm/versions/node/v6.1.0/bin/npm
$ npm config get prefix
/home/dominic/Github/dominicbarnes/dotfiles/nvm/versions/node/v6.1.0 It looks to me as if the |
aha, i suspect the issue might be capitalization - ie, |
My fs is case-sensitive, and I wonder if this has to do with symlinks? My In my bashrc, I'm using: source ~/.dotfiles/nvm/nvm.sh I'll try using the longer path that isn't behind a symlink to see if that makes a difference. |
Well, it turns out that using: source ~/Github/dominicbarnes/dotfiles/nvm/nvm.sh` Then it works, so it appears like there is a problem with "sourcing" it in a directory that is behind a symlink. I think that would be considered a bug, but not sure how best to address it. |
Ah. Yes, that's the problem. |
Oddly enough, this error has shown back up for me on OSX. (despite the fact that I'm not using a symlink, which fixed the error on linux) |
@dominicbarnes can you file a separate issue for your new OS X problem, including |
@dominicbarnes can you link the OS X version of this problem? I am having the same issue. Thanks. |
Same problem. $ sw_vers $ nvm debug |
@p4ali |
I am having exactly the same issue:
I installed
After that I installed the LTS version (v6.9.2) through nvm:
Getting this message: So, in order to use node I have to run This is how my
And after I run
|
@rauliyohmc it's likely because |
That was it @ljharb, thanks a lot 🤖 |
I was having the same issue trying to 'purify' my node versions, since I had noticed my 'system' version was pretty old (0.10.x). After uninstalling all version, reinstalling nvm and using it to install now, I was getting the prefix errors. Doesn't get to the root of the issue, but a fix that worked for me was to install node from the package at nodejs.org. The prefix error goes away for me if
|
@alanguir what's your |
It only shows up on one machine, where I have /home symlinked to a different mount point. nvm-sh/nvm#855 nvm-sh/nvm#1087 nvm-sh/nvm#1224 nvm-sh/nvm#1245 http://stackoverflow.com/questions/34718528/nvm-is-not-compatible-with-the-npm-config-prefix-option
It only shows up on one machine, where I have /home symlinked to a different mount point. nvm-sh/nvm#855 nvm-sh/nvm#1087 nvm-sh/nvm#1224 nvm-sh/nvm#1245 http://stackoverflow.com/questions/34718528/nvm-is-not-compatible-with-the-npm-config-prefix-option
It only shows up on one machine, where I have /home symlinked to a different mount point. nvm-sh/nvm#855 nvm-sh/nvm#1087 nvm-sh/nvm#1224 nvm-sh/nvm#1245 http://stackoverflow.com/questions/34718528/nvm-is-not-compatible-with-the-npm-config-prefix-option
My system is Ubuntu 16.04, zsh, oh-my-zsh, with zsh-nvm and npm plugins. Node is installed via umake. I was getting this error. Deleted my $NVM_DIR, exited my terminal, restarted it, and let the zsh-nvm plugin re-add it (from this repo). Now no error. Now instead of sad and confused, I'm happy and confused. |
Im getting this error after following the same process @rauliyohmc did about removing the prefix This is my nvm debug
|
@adim86 any chance that you're using a symlink for |
No I did not do a symlink between$HOME and the NVM_DIR.
One thing though is that I am on Ubuntu VPS and I think that is case sensitive. What would be the solution if that is the issue?
|
case-sensitive should be fine. if it's case-insensitive, ensure that the casing of |
I had this issue for the past week, and I finally sat down and took two hours to fix this. Here is what worked for me: First of all, I wanted to keep the global node modules. So I ran Then it was about removing all traces of NVM, Node, and NPM:
Then I used https://github.com/lukechilds/zsh-nvm to install NVM again (I am using Oh-My-ZSH). Next step, installing the latest Node version that I wanted I finally have a system that's working again and not nagging me about this damn PREFIX thing 👍 . |
I am on a linux (ubuntu) machine, just getting started with nvm. (removed all prior installations of node, npm, and n)
I've seen this documented around in the readme, and I read the related tickets. However, I did not set any custom prefix at any point. The instructions it gives work for the time, but the error shows right back up for each new terminal session.
I suspect this is because I don't have any version of node/npm installed at the system level, so whatever is trying to look for the broken prefix value may be getting unexpected behavior, but I'm not sure.(see next comment below, I think I've ruled this out)The prefix option that nvm reports to me appears to be generated on it's own, as I don't have a
$PREFIX
or$NPM_CONFIG_PREFIX
option anywhere in my env. (nor is there aprofile=...
in my~/.npmrc
)The text was updated successfully, but these errors were encountered: