nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
80.25k stars 8.02k forks source link

nvm install command fails on FreeBSD #1552

Closed honzahommer closed 5 years ago

honzahommer commented 7 years ago

=> Appending nvm source string to /root/.profile => bash_completion source string already in /root/.profile => Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm


- What steps did you perform?
```sh
$ nvm install v8.1.0

Makefile:90: *** Missing or stale config.gypi, please run ./configure. Stop. nvm: install v8.1.0 failed!


- Is there anything in any of your profile files (`.bashrc`, `.bash_profile`, `.zshrc`, etc) that modifies the `PATH`?
```sh
$ cat .profile 
# $FreeBSD: releng/11.0/etc/root/dot.profile 278616 2015-02-12 05:35:00Z cperciva $
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:~/bin
export PATH
HOME=/root
export HOME
TERM=${TERM:-xterm}
export TERM
PAGER=more
export PAGER
PS1="\$ "
export PS1

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

...

Now using node v8.1.0 (npm v5.0.3)

ljharb commented 7 years ago

900, #1207, #130 may be relevant here.

ljharb commented 7 years ago

These lines for FreeBSD set $CC to cc and $CXX to c++ if they're not otherwise set.

It looks like yours are already set to g++ and gcc respectively - what does which g++ and which gcc report?

honzahommer commented 7 years ago

which g++ and which gcc returns nothing.

ljharb commented 7 years ago

Sounds like that might be the problem - your CC and CXX vars are set to nonexistent compilers. If you unset CC CXX (or remove "setting them" from your profile files), I'd expect everything to work.

tizzyapunkt commented 6 years ago

I ran into the same issue using nvm 0.33.11. Manually exporting CC=cc and CXX=c++ worked for me.