hexo init时gyp出现错误

hexo init时gyp出现错误

hexo init时gyp出现错误,原因是

Xcode 重命名后,xcodebuild 找不到原来的Xcode。所以,我们重新设置 Xcode的路径。

过程记录如下:

 shaochenyang@shaochenyangs-MacBook-Pro  ~/Document_Local/Blog  hexo init
INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
正克隆到 '/Users/shaochenyang/Document_Local/Blog'...
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 161 (delta 12), reused 12 (delta 4), pack-reused 131
接收对象中: 100% (161/161), 31.79 KiB | 9.00 KiB/s, 完成.
处理 delta 中: 100% (74/74), 完成.
子模组 'themes/landscape'(https://github.com/hexojs/hexo-theme-landscape.git)已对路径 'themes/landscape' 注册
正克隆到 '/Users/shaochenyang/Document_Local/Blog/themes/landscape'...
remote: Enumerating objects: 1054, done.
remote: Total 1054 (delta 0), reused 0 (delta 0), pack-reused 1054
接收对象中: 100% (1054/1054), 3.21 MiB | 14.00 KiB/s, 完成.
处理 delta 中: 100% (581/581), 完成.
Submodule path 'themes/landscape': checked out '73a23c51f8487cfcd7c6deec96ccc7543960d350'
INFO  Install dependencies

> fsevents@1.2.11 install /Users/shaochenyang/Document_Local/Blog/node_modules/nunjucks/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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:223:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.2.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/shaochenyang/Document_Local/Blog/node_modules/nunjucks/node_modules/fsevents
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

> ejs@2.7.4 postinstall /Users/shaochenyang/Document_Local/Blog/node_modules/ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/nunjucks/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

added 373 packages from 477 contributors and audited 2643 packages in 87.344s

5 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

INFO  Start blogging with Hexo!

输入sudo xcode-select -s /Applications/Xcode.app/Contents/Developer并回车

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值