Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++: error: unrecognized command line option '-stdlib=libc++' while installing a node package

Tags:

npm

g++

Running npm install for a library fails with error:

c++: error: unrecognized command line option '-stdlib=libc++'

like image 813
sebastian serrano Avatar asked Jul 10 '16 16:07

sebastian serrano


2 Answers

For those who are still having this problem, the below command worked for me on fish shell and macOS.

env CC=clang CXX=clang++ npm install XXX
like image 144
Daisuke SHIBATO Avatar answered Nov 19 '22 10:11

Daisuke SHIBATO


Running npm install with the enviroment variable CXX=clang++ made it work:

CXX=clang++ npm install ...
like image 24
sebastian serrano Avatar answered Nov 19 '22 10:11

sebastian serrano