OSX El Capitan node-5.0.0 under sudo npm install encounters a permissions issue

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.