MacOS入坑指南

2020-11-04 10:32:44 浏览数 (1)

应用

Homebrew

macos平台的包管理器

使用下面命令全自动换源安装

代码语言:javascript复制
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

简单操作

  • 更新 brew update
  • 下载应用 brew install xxx
  • 卸载应用 brew uninstall xxx

Cakebrew

图形化的homebrew,方便快捷的管理brew下载的应用和所有软件包

Parallels Desktop

强大的虚拟机应用,完美兼容macos的各种骚操作

注意:从Vmware导入到macos时,需要将整个虚拟镜像的文件夹后缀更改为.vmware格式,即可直接倒入到PD虚拟机

三种模式

  • 共享网络 与主机共享虚拟网络,可以访问外网
  • host only 建立专用的网络,不可访问外网
  • 桥接网络 使用主机的硬件接入到网络中,可以访问外网

Typora

专业的markdown写作应用,可结合Picgo Gitee图床,从剪切板自动上传图片到图床

Picgo需单独下载 地址:https://github.com/Molunerfinn/PicGo

超级右键

可实现在文件夹中右键进入vscode、iterm2和新建word、ppt等功能

istat menus

在状态栏显示性能图标

Hexo博客迁移

将hexo从windows迁移至macos环境

安装node

代码语言:javascript复制
$ brew install node
npm换国内源
代码语言:javascript复制
$ npm config set registry https://registry.npm.taobao.org
$ npm install -g npm

安装hexo

代码语言:javascript复制
$ npm i -g hexo
初始化hexo
代码语言:javascript复制
$ hexo init
//安装部署插件
$ npm install hexo-deployer-git --save
//配置个人信息
$ git config --global user.name "yourname”
$ git config --global user.email youremail@example.com

报错

代码语言:javascript复制
$ hexo d
(node:61234) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:61234) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:61234) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:61234) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:61234) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:61234) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
TypeError [ERR_INVALID_ARG_TYPE]: The "mode" argument must be integer. Received an instance of Object
    at copyFile (fs.js:1895:10)
    at tryCatcher (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/util.js:16:23)
    at ret (eval at makeNodePromisifiedEval (/usr/local/lib/node_modules/hexo/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)
    at /Users/DA1SY1/Blog/Gitee/node_modules/hexo-fs/lib/fs.js:144:39
    at tryCatcher (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:673:18)
    at Promise._resolveCallback (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:466:57)
    at Promise._settlePromiseFromHandler (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:559:17)
    at Promise._settlePromise (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:673:18)
    at Promise._resolveCallback (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:466:57)
    at Promise._settlePromiseFromHandler (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:559:17)
    at Promise._settlePromise (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:673:18)
    at Promise._resolveCallback (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:466:57)
    at Promise._settlePromiseFromHandler (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:559:17)
    at Promise._settlePromise (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:729:18)
    at Promise._fulfill (/Users/DA1SY1/Blog/Gitee/node_modules/bluebird/js/release/promise.js:673:18)

原因是当前node的版本过高,可以安装比较稳定的12.14.0

代码语言:javascript复制
$ npm install -g n
$ sudo n v12.14.0

0 人点赞