简体   繁体   中英

“gyp ERR! stack” with NodeJS, but XCode Command Line Tools in installed

After I install new npm package i get this error:

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/local/.nvm/versions/node/v14.15.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

But if i tried to install the XCode Command Line Tools xcode-select --install I got the next message: xcode-select: error: xcode-select: error: command line tools are already installed, use "Software Update" to install updates My ios version is Big Sur .

Thanks!

First option
Disclaimer usually this is not enough from Big Sur macOS onwards, so you have to do second (longer) approach described bellow.

# reset your XCode Command Line Tools
sudo xcode-select --reset

Second option
Reinstall XCode Command Line Tools:

# gets the path
xcode-select --print-path

# use returned path
sudo rm -r -f /Library/Developer/CommandLineTools

# install it again
xcode-select --install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM