NPM fatal error: 'errno.h' file not found #741

遇到的錯(cuò)誤提示


Installing assert-plus@^1.0.0  CXX(target) Release/obj.target/node_sleep/sleep.o
In file included from ../sleep.cc:2:
In file included from ../../_nan@2.7.0@nan/nan.h:48:
In file included from /Users/haohao/.node-gyp/6.11.5/include/node/uv.h:48:
/Users/haohao/.node-gyp/6.11.5/include/node/uv-errno.h:25:10: fatal error: 'errno.h' file not found
#include <errno.h>
         ^~~~~~~~~



解決方法

重新安裝CommandLineTools工具

  • rm -rf /Library/Developer/CommandLineTools
  • xcode-select --install
xcode-select: note: install requested for command line developer tools

點(diǎn)擊安裝開始下載安裝Xcode Command Line Tools

驗(yàn)證下是否安裝成功

  • xcode-select -p
/Applications/Xcode.app/Contents/Developer
  • gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

這樣應(yīng)該就能解決問題了

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容