Cada vez que intento npm install
. Obtuve el siguiente error. ¿Cómo lo soluciono?
gyp: No Xcode or CLT version detected!
Estoy en el node -v → v8.8.0
& npm -v → v6.11.3
Traté de ejecutarlo en la terminal VSCode e iTerm, pero ambos terminaron recibiendo el mismo error. (ambos están actualizados a la última versión). Lo único nuevo que hice fue actualizar mi macOS a la última versión (Catalina 10.15.3 hoy).
$ npm install Fri Mar 6 17:22:40 2020 > fsevents@1.2.11 install /Users/synapse/Documents/synapsefi-dev-ui/node_modules/watchpack/node_modules/fsevents > node-gyp rebuild No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'. No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'. 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/synapse/.nvm/versions/node/v8.8.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:344:16) gyp ERR! stack at emitTwo (events.js:125:13) gyp ERR! stack at ChildProcess.emit (events.js:213:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Darwin 19.3.0 gyp ERR! command "/Users/synapse/.nvm/versions/node/v8.8.0/bin/node" "/Users/synapse/.nvm/versions/node/v8.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/synapse/Documents/synapsefi-dev-ui/node_modules/watchpack/node_modules/fsevents gyp ERR! node -v v8.8.0 gyp ERR! node-gyp -v v5.0.3 gyp ERR! not ok npm WARN synapsefi-dev-ui@2.0.20 No repository field. npm WARN The package country-data is included as both a dev and production dependency. npm WARN The package react-dropzone is included as both a dev and production dependency. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/watchpack/node_modules/fsevents): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 install: `node-gyp rebuild` npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
A pesar de que los tiene instalados (mi caso), pero al actualizar a Catalina (10.15.*) puede obtener este error (mi caso :)).
Por lo tanto, la simple instalación no ayudaría, ya que obtendrá un error de que ya están instalados.
Por lo tanto, es de esperar que solo (I) reinicie la herramienta o, en el peor de los casos, (II) desinstale e instale (requiere una gran descarga ) nuevamente (esto se basa en la respuesta de @Dane_duPlessis).
# just for а preview (not necessary) xcode-select --print-path # in my case it printed `/Library/Developer/CommandLineTools` # could be useful if the path is making a problem sudo xcode-select --switch /Library/Developer/CommandLineTools # only for the (I) resetting case sudo xcode-select --reset # only for the (II) uninstalling case - the next line deletes folder returned by the `xcode-select --print-path` command sudo rm -rf $(xcode-select --print-path) # only for the (II) uninstalling case - install tools (again) if you don't get a default installation prompt xcode-select --install
NOTA :
Créditos a: gyp: No se detectó ninguna versión de Xcode o CLT macOS Catalina
Esto funcionó para mí con macOS Catalina Versión 10.15.5:
$ xcode-select --print-path /Applications/Xcode.app/Contents/Developer $ sudo xcode-select --switch /Library/Developer/CommandLineTools ... $ sudo xcode-select --reset ...
Las herramientas de xcode cli ahora deberían estar accesibles. No es necesario volver a instalar nada.
Supongo que es posible que haya probado varias soluciones hasta ahora, pero si ninguna de esas soluciones le ha funcionado todavía, no se preocupe, lo tengo. :)
Soluciones que no funcionan:
xcode-select --install
no funcionó para mí (macOS Catalina 10.15.7) ya que aparece un cuadro de diálogo Actualización de software que dice Can't install the software because it is currently not available from the Software Update Server
.sudo xcode-select --reset
tampoco funcionó para mí.Solución de trabajo:
Esto es lo que funcionó para mí, es decir, reinstalar las herramientas de línea de comandos de Xcode usando Actualización de software manualmente.
softwareupdate -l
sudo touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
softwareupdate -l
nuevamente.Software Update
. Inicie la Software Update
.sudo rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
.