npm install 時(shí)報(bào)錯(cuò)信息如下:
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/argen/Desktop/code/work/2020/220/finwhale/marketing-center/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.4.0
gyp ERR! command "/usr/local/bin/node" "/Users/argen/Desktop/code/work/2020/220/finwhale/marketing-center/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/argen/Desktop/code/work/2020/220/finwhale/marketing-center/node_modules/node-sass
gyp ERR! node -v v14.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
解決辦法:
sudo xcode-select --install
xcode-select --print-path // 曾經(jīng)安裝過的路徑
sudo rm -rf /Library/Developer/CommandLineTools // 刪掉之前的
sudo xcode-select --install // 再安裝一次
gcc -v // 查看是否安裝成功