Handle global npm install properly

Please merge.