The problem comes from newer versions of Xcode command line tools on recent MacOS versions.

The crucial part in the log is:

  CXX(target) Release/obj.target/node_libcurl/src/node_libcurl.o
clang: error: no such file or directory: '/usr/include'
make: *** [Release/obj.target/node_libcurl/src/node_libcurl.o] Error 1

As the node-libcurl docs state:

newer versions of the Command Line Tools does not add the /usr/include folder by default. Check Xcode 10 release notes for details.

To fix this, we need to tell npm install about the new location of /usr/include which is $(xcrun --show-sdk-path)/usr/include by setting the npm environment variable npm_config_curl_include_dirs like this:

npm_config_curl_include_dirs="$(xcrun --show-sdk-path)/usr/include" npm install -g node-libcurl

In my case where I wanted to install another npm library like insomnia-inso in the first place, you need to add both npm libraries to the command in order to do a successful installation:

npm_config_curl_include_dirs="$(xcrun --show-sdk-path)/usr/include" npm install -g node-libcurl insomnia-inso

Now the installation of insomnia-inso worked like a charm.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top