Although it is not recommended to use sudo to install NPM packages, you often inevitably go so ⊙﹏⊙ b Khan.
For example, we're going to install FISP, the NPM package.
$ sudo cnpm install-g fis-plus
Results The first line error is:
Gyp WARN eacces User "root" does not has permission to access the dev dir "/users/xxx/.node-gyp/5.0.0"
Obvious permission problems! But I used sudo (⊙o⊙) Wow!!!
So to find the answer to help Google the next key words first went to StackOverflow, someone asked, sure enough I am not a case, but no one answer, embarrassed, is this a new problem?
Then there were only two search results, and the second one took me to GitHub. learned that OSX El capitan the root authority to weaken, before many system paths have no write permission (⊙o⊙) Ah!
Then follow the directions of the answer to a reliable solution document, or GitHub.
It's all on the back of my nagging journey, the dry is to add a parameter:
$ sudo npm install-g package_name--unsafe-perm
Summary: This benefit Dafa is very smooth ah!
OSX El Capitan node-5.0.0 under sudo npm install encounters a permissions issue