使用 cnpm 命令行工具代替 npm

直接使用 npm 总是会出现莫名的错误,cnpm 直接从国内的镜像站点下载,不用记住复杂的 registry 参数

npm install -g cnpm

如果安装 cnpm 也失败的话,那就得加上 registry 参数来从国内镜像安装

npm install -g cnpm --registry=https://registry.npm.taobao.org

然后就可以替换掉 npm 命令直接使用

cnpm install -g gulp
cnpm install

OS X EI Capitan 安装 CH341 串口驱动

之前使用 Yosemite 的时候,使用 CH341 的串口驱动是需要打开 kext 的调试模式的,有点麻烦但更令人感到些许不安:

sudo nvram boot-args="kext-dev-mode=1"

这次升级 EI Capitan 后,把 kext-dev-mode 给关闭掉了,没想到 CH341 的串口驱动也可以直接使用,看来已经认证过了。

$ nvram -p
......
boot-args	kext-dev-mode=0
......

驱动下载地址:http://www.wch.cn/download/CH341SER_MAC_ZIP.html

homebrew 安装最新版 composer

使用 brew 安装稳定版的 composer 版本是 1.2.0 的,可是一运行 composer 就提示:

PHP Fatal error:  Uncaught PharException: phar "/Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar" SHA1 signature could not be verified: broken signature in /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar:23
Stack trace:
#0 /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar(23): Phar::mapPhar('composer.phar')
#1 {main}
  thrown in /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar on line 23

Fatal error: Uncaught PharException: phar "/Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar" SHA1 signature could not be verified: broken signature in /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar on line 23

PharException: phar "/Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar" SHA1 signature could not be verified: broken signature in /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar on line 23

Call Stack:
    0.0063     359032   1. {main}() /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar:0
    0.0064     359032   2. Phar::mapPhar() /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar:23

就想直接安装 master 版看看,搜了一下 homebrew 还真有真有这个参数,安装后 composer 就又可以正常运行了。

brew install composer --HEAD