npm install fails on node-gyp rebuild with ```gyp: No Xcode or CLT version detected!```

野性酷女 2023-03-01 12:28 75阅读 0赞

npm install fails on node-gyp rebuild with gyp: No Xcode or CLT version detected!

  1. $ npm install Fri Mar 6 17:22:40 2020
  2. > fsevents@1.2.11 install /Users/synapse/Documents/synapsefi-dev-ui/node_modules/watchpack/node_modules/fsevents
  3. > node-gyp rebuild
  4. No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
  5. No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
  6. No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
  7. gyp: No Xcode or CLT version detected!
  8. gyp ERR! configure error
  9. gyp ERR! stack Error: `gyp` failed with exit code: 1
  10. 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)
  11. gyp ERR! stack at emitTwo (events.js:125:13)
  12. gyp ERR! stack at ChildProcess.emit (events.js:213:7)
  13. gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
  14. gyp ERR! System Darwin 19.3.0
  15. 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"
  16. gyp ERR! cwd /Users/synapse/Documents/synapsefi-dev-ui/node_modules/watchpack/node_modules/fsevents
  17. gyp ERR! node -v v8.8.0
  18. gyp ERR! node-gyp -v v5.0.3
  19. gyp ERR! not ok
  20. npm WARN synapsefi-dev-ui@2.0.20 No repository field.
  21. npm WARN The package country-data is included as both a dev and production dependency.
  22. npm WARN The package react-dropzone is included as both a dev and production dependency.
  23. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/watchpack/node_modules/fsevents):
  24. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 install: `node-gyp rebuild`
  25. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

原因:系统升级到Catalina (10.15.*)就可能碰到。

解决方法:卸载并重新安装xcode-select

  1. xcode-select --print-path
  2. # in my case /Library/Developer/CommandLineTools
  3. # the next line deletes the path returned by the command above
  4. sudo rm -rf $(xcode-select --print-path)
  5. # install them (again)
  6. xcode-select --install

原文:https://stackoverflow.com/questions/60573595/npm-install-fails-on-node-gyp-rebuild-with-gyp-no-xcode-or-clt-version-detec

发表评论

表情:
评论列表 (有 0 条评论,75人围观)

还没有评论,来说两句吧...

相关阅读