Skip to content
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 command fails on FreeBSD #1552

Closed
honzahommer opened this issue Jun 11, 2017 · 5 comments
Closed

nvm install command fails on FreeBSD #1552

honzahommer opened this issue Jun 11, 2017 · 5 comments
Labels
installing node Issues with installing node/io.js versions. OS: FreeBSD / OpenBSD

Comments

@honzahommer
Copy link

honzahommer commented Jun 11, 2017

  • Operating system and version:
    FreeBSD nvm 11.0-RELEASE-p9 FreeBSD 11.0-RELEASE-p9 #0: Tue Apr 11 08:48:40 UTC 2017 root@amd64-builder.daemonology.net:/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)
@honzahommer honzahommer changed the title nvm install failed on FreeBSD (failed to autodetect compilers) nvm install command fails on FreeBSD Jun 11, 2017
@ljharb
Copy link
Member

ljharb commented Jun 11, 2017

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

@ljharb ljharb added OS: FreeBSD / OpenBSD installing node Issues with installing node/io.js versions. labels Jun 11, 2017
@ljharb
Copy link
Member

ljharb commented Jun 11, 2017

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
Copy link
Author

which g++ and which gcc returns nothing.

@ljharb
Copy link
Member

ljharb commented Jun 12, 2017

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions. OS: FreeBSD / OpenBSD
Projects
None yet
Development

No branches or pull requests

3 participants