Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>As for October 2014:</strong></p> <p>Node.js is available from the NodeSource Debian and Ubuntu binary distributions <a href="https://github.com/nodesource/distributions" rel="nofollow noreferrer">repository</a>.</p> <pre><code>curl -sL https://deb.nodesource.com/setup | sudo bash - sudo apt-get install -y nodejs </code></pre> <p>That's it.</p> <p><strong>Outdated answer:</strong></p> <p>The fastest way without using sudo is like described <a href="http://howtonode.org/introduction-to-npm" rel="nofollow noreferrer">here by isaac</a></p> <blockquote> <p>I strongly encourage you not to do package management with sudo! Packages can run arbitrary scripts, which makes sudoing a package manager command as safe as a chainsaw haircut. Sure, it's fast and definitely going to cut through any obstacles, but you might actually want that obstacle to stay there.</p> <p>I recommend doing this once instead:</p> </blockquote> <pre><code>sudo chown -R $USER /usr/local </code></pre> <p><strong>EDIT:</strong></p> <p>There are certain security concerns and functionality limitations regarding changing the ownership of /usr/local to the current user:</p> <ul> <li>if there is another user on the machine who could use global npm packages - do not change the ownership of /usr/local</li> <li><a href="https://apple.stackexchange.com/questions/1393/are-my-permissions-for-usr-local-correct">https://apple.stackexchange.com/questions/1393/are-my-permissions-for-usr-local-correct</a></li> <li><a href="https://askubuntu.com/questions/261326/is-it-safe-to-chown-usr-local">https://askubuntu.com/questions/261326/is-it-safe-to-chown-usr-local</a></li> </ul> <p>Having said that, if you want to install global module without using sudo, I don't see any better solution (from pragmatic point of view) than mentioned. Security vs easy of use is very broad topic, and there is no easy answer for that - it just depends on your requirements.</p>
 

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