Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The error message is fairly clear:</p> <pre><code>npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules/___coffee-script.npm' npm ERR! npm ERR! Please try running this command again as root/Administrator. </code></pre> <p>You can't install it in <code>/usr/local/lib/node_modules</code> because you don't have the necessary permissions. Try using <code>sudo</code>:</p> <pre><code>dylan-hermans-macbook:~ sudo npm install -g coffee-script </code></pre> <hr> <p>The npm author recommends not using <code>sudo</code> because packages can run arbitrary commands so <code>sudo npm install</code> is dangerous. He suggests switching the ownership of <code>/usr/local</code> to your user. I think that's horribly advice that just gives you a false sense of security: if a package can run arbitrary commands then it can mess with your home directory (including all your personal data, executables, config and startup files, ...) regardless of <code>sudo</code> or who owns <code>/usr/local</code> so not using <code>sudo</code> really doesn't do much for you. If you don't trust a package then don't install it; if you don't trust a package then how can you even use it? The <code>/usr/local</code> tree is still a system directory tree and OSX is still a multi-user operating system.</p> <p>IMO a much better solution is twofold:</p> <ol> <li>Don't install or use any packages that you don't trust. If you install it then you're trusting that code to be you (unless you're always going to run it in a jail of some sort but if you're going to those lengths you're probably better off writing the code yourself).</li> <li>Leave <code>sudo</code> and <code>/usr/local</code> alone and install it all inside your home directory. You'll be subject to most of the same dangers as using <code>sudo</code> or changing the <code>/usr/local</code> ownership but at least you won't be picking up bad habits.</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload