安装完成 再次手动启动下homebridge 应该回显中会出现 下面错误提示npm update check failed :
这是因为node默认装载 /usr 下面 而homebridge 在/usr/local下面找命令 按理说 可以做个软连接到 /usr ln -s /usr/local /usr(未测试,有兴趣的可以测试下)。我按照这种方法操作的:
输入 npm config get prefix 可以看到 回显确实在 /usr 下面键入代码:
####################### Make a directory for global installations:#######################
mkdir ~/.npm-global
#######################Configure npm to use the new directory path:#######################
npm config set prefix '~/.npm-global'
#######################Open or create a ~/.profile file and add this line:#######################
export PATH=~/.npm-global/bin:(去掉中文和括号)$PATH
####################### Back on the command line, update your system variables:#######################
source ~/.profile