熱崇 | Cult OW! OW!

如何升級Hexo和Vercel

互聯網 ·

作为一个比较迷恋升级的伪类程序员,哪能不尝鲜。
有了新版本我就会迷信的认为新版本的东西肯定好用功能多了呀。
所以Hexo我也希望是最新版本。于是,开始升级Hexo。

这里再加上vercel的安装方法。

Hexo升级

  1. 全局升级hexo-cli,先hexo version 或者hexo v查看当前版本;然后npm i hexo-cli -g,再次hexo v查看是否升级成功。
  2. 使用npm install -g npm-checknpm-check,检查系统中的插件是否有升级的,可以看到自己都安装过哪些插件。
  3. 使用npm install -g npm-upgradenpm-upgrade,升级系统中的插件。
  4. 使用npm update -gnpm update --save

报错

如果以上最后一步出错,提示如下

> [email protected] install /Users/lanvnal/Files/blog/node_modules/hexo/node_modules/fsevents
> node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

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!

其实已经安装过了xcode cli,但是这里还是报错了,估计和苹果新系统有关,重装就好了,操作如下:

如果像以前一样执行xcode-select --install会有如下报错:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

解决办法:

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

然后再执行第四步,完美升级。

vercel 安装(Download Vercel)

$ npm i -g vercel

$ yarn global add vercel

So easy!!

# # # # #