首页 编程开发Mac下vue-cli4创建项目报错:gyp: No Xcode or CLT version detected!解决办法

Mac下vue-cli4创建项目报错:gyp: No Xcode or CLT version detected!解决办法

分类:编程开发
字数: (1200)
阅读: (6242)

在Mac上使用vue-cli4创建项目时报错,提示:gyp: No Xcode or CLT version detected!

完整报错信息如下

> 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jaeheng/workspace/vue-cell-cube/node_modules/fsevents
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

解决办法:

1. 安装xcode

2. 打开一下xcode,打开过程中会自动安装一些别的

3. 使用vue-cli重新创建项目


如果是catalina系统,可能还会报这个错,需要运行命令:

> sudo xcode-select -s /Applications/Xcode.app/Contents/Developer


转载请注明出处: 皮哈皮阿

本文的链接地址: https://blog.phpat.com/web/494.html

本文最后发布于2020年02月12日19:56,已经过了1836天没有更新,若内容或图片失效,请留言反馈


扫描二维码,在手机上阅读
()
评论本文(1)
评论列表:
太仓人才网
回复
这个方法可以!感谢

4 年前