nvm install command fails on FreeBSD

Created on 11 Jun 2017  路  5Comments  路  Source: nvm-sh/nvm

  • Operating system and version:
    FreeBSD nvm 11.0-RELEASE-p9 FreeBSD 11.0-RELEASE-p9 #0: Tue Apr 11 08:48:40 UTC 2017 [email protected]:/usr/obj/usr/src/sys/GENERIC amd64, clean install on Vultr.com, run as root user.

  • How did you install nvm? (e.g. install script in readme, homebrew):

$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
=> Downloading nvm from git to '/root/.nvm'
=> Cloning into '/root/.nvm'...
remote: Counting objects: 6436, done.
remote: Total 6436 (delta 0), reused 0 (delta 0), pack-reused 6435
Receiving objects: 100% (6436/6436), 1.89 MiB | 0 bytes/s, done.
Resolving deltas: 100% (3990/3990), done.
* (HEAD detached at v0.33.2)
  master
=> Compressing and cleaning up git repository
Counting objects: 6436, done.
Compressing objects: 100% (6392/6392), done.
Writing objects: 100% (6436/6436), done.
Total 6436 (delta 4250), reused 1980 (delta 0)

=> 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?
$ nvm install v8.1.0
  • What happened?
Currently, there is no binary for freebsd
Detected that you have 1 CPU core(s)
Number of CPU core(s) less than or equal to 2, running in single-threaded mode
Downloading https://nodejs.org/dist/v8.1.0/node-v8.1.0.tar.xz...
######################################################################## 100.0%
Computing checksum with shasum -a 256
Checksums matched!
$>./configure --prefix=/root/.nvm/versions/node/v8.1.0 <
WARNING: failed to autodetect C++ compiler version (CXX=g++)
WARNING: failed to autodetect C compiler version (CC=gcc)
Node.js configure error: No acceptable C compiler found!

        Please make sure you have a C compiler installed on your system and/or
        consider adjusting the CC environment variable if you installed
        it in a non-standard prefix.

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?
$ 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
  • It looks, there is an issue with CC and CXX variables in nvm.sh. If I export these variables before installation, everything is OK.
$ export CC=cc  
$ export CXX=c++
$ nvm install v8.1.0
Currently, there is no binary for freebsd
Detected that you have 1 CPU core(s)
Number of CPU core(s) less than or equal to 2, running in single-threaded mode
Local cache found: $NVM_DIR/.cache/src/node-v8.1.0/node-v8.1.0.tar.xz
Checksums match! Using existing downloaded archive $NVM_DIR/.cache/src/node-v8.1.0/node-v8.1.0.tar.xz
$>./configure --prefix=/root/.nvm/versions/node/v8.1.0 <
creating ./icu_config.gypi
* Using ICU in deps/icu-small
creating ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},

...

Now using node v8.1.0 (npm v5.0.3)
FreeBSD / OpenBSD installing node

Most helpful comment

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

All 5 comments

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

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?

which g++ and which gcc returns nothing.

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ssbothwell picture ssbothwell  路  4Comments

dtgriscom picture dtgriscom  路  4Comments

tongxiaofeng picture tongxiaofeng  路  5Comments

raitucarp picture raitucarp  路  3Comments

danielepolencic picture danielepolencic  路  4Comments