support global installation with 'npm install -g' (#374)