title: What is the proper way to install NPM and NodeJS?
body: <p>What is the proper way to install NPM and NodeJS ?</p>
  
  <p><strong>Method 1 .</strong>: <code>sudo apt-get install npm</code></p>
  
  <pre><code>sudo apt-get install npm
  
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  Some packages could not be installed. This may mean that you have
  requested an impossible situation or if you are using the unstable
  distribution that some required packages have not yet been created
  or been moved out of Incoming.
  The following information may help to resolve the situation:
  
  The following packages have unmet dependencies:
   npm : Depends: nodejs but it is not going to be installed
         Depends: node-abbrev (&gt;= 1.0.4) but it is not going to be installed
         Depends: node-ansi but it is not going to be installed
         Depends: node-archy but it is not going to be installed
         Depends: node-block-stream but it is not going to be installed
         Depends: node-fstream (&gt;= 0.1.22) but it is not going to be installed
         Depends: node-fstream-ignore but it is not going to be installed
         Depends: node-github-url-from-git but it is not going to be installed
         Depends: node-glob (&gt;= 3.1.21) but it is not going to be installed
         Depends: node-graceful-fs (&gt;= 2.0.0) but it is not going to be installed
         Depends: node-inherits but it is not going to be installed
         Depends: node-ini (&gt;= 1.1.0) but it is not going to be installed
         Depends: node-lockfile but it is not going to be installed
         Depends: node-lru-cache (&gt;= 2.3.0) but it is not going to be installed
         Depends: node-minimatch (&gt;= 0.2.11) but it is not going to be installed
         Depends: node-mkdirp (&gt;= 0.3.3) but it is not going to be installed
         Depends: node-gyp (&gt;= 0.10.9) but it is not going to be installed
         Depends: node-nopt (&gt;= 2.1.1) but it is not going to be installed
         Depends: node-npmlog but it is not going to be installed
         Depends: node-once but it is not going to be installed
         Depends: node-osenv but it is not going to be installed
         Depends: node-read but it is not going to be installed
         Depends: node-read-package-json (&gt;= 1.1.0) but it is not going to be installed
         Depends: node-request (&gt;= 2.25.0) but it is not going to be installed
         Depends: node-retry but it is not going to be installed
         Depends: node-rimraf (&gt;= 2.2.2) but it is not going to be installed
         Depends: node-semver (&gt;= 2.1.0) but it is not going to be installed
         Depends: node-sha but it is not going to be installed
         Depends: node-slide but it is not going to be installed
         Depends: node-tar (&gt;= 0.1.18) but it is not going to be installed
         Depends: node-which but it is not going to be installed
  E: Unable to correct problems, you have held broken packages.
  </code></pre>
  
  <p>======================================================================
  <strong>Method 2.</strong> <code>curl -L https://npmjs.com/install.sh | sh</code></p>
  
  <pre><code>curl -L https://npmjs.com/install.sh | sh  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100   193  100   193    0     0    132      0  0:00:01  0:00:01 --:--:--   132
  100  6239  100  6239    0     0   1976      0  0:00:03  0:00:03 --:--:--  6986
  tar=/bin/tar
  version:
  tar (GNU tar) 1.27.1
  Copyright (C) 2013 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;.
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
  
  Written by John Gilmore and Jay Fenlason.
  install npm@latest
  fetching: http://registry.npmjs.org/npm/-/npm-2.4.1.tgz
  unbuild npm@2.5.0
  npm ERR! Linux 3.13.0-44-generic
  npm ERR! argv "/usr/bin/node" "/tmp/npm.14799/package/cli.js" "rm" "npm" "-gf"
  npm ERR! node v0.10.36
  npm ERR! npm  v2.4.1
  npm ERR! path /usr/bin/npm
  npm ERR! code EACCES
  npm ERR! errno 3
  
  npm ERR! Error: EACCES, unlink '/usr/bin/npm'
  npm ERR!  { [Error: EACCES, unlink '/usr/bin/npm'] errno: 3, code: 'EACCES', path: '/usr/bin/npm' }
  npm ERR! 
  npm ERR! Please try running this command again as root/Administrator.
  
  npm ERR! Please include the following file with any support request:
  npm ERR!     /tmp/npm.14799/package/npm-debug.log
  
  &gt; npm@2.4.1 prepublish /tmp/npm.14799/package
  &gt; node bin/npm-cli.js prune --prefix=. --no-global &amp;&amp; rm -rf test/*/*/node_modules &amp;&amp; make -j8 doc
  
  make: Nothing to be done for `doc'.
  npm ERR! Linux 3.13.0-44-generic
  npm ERR! argv "/usr/bin/node" "/tmp/npm.14799/package/cli.js" "install" "-gf"
  npm ERR! node v0.10.36
  npm ERR! npm  v2.4.1
  npm ERR! path /usr/bin/npm
  npm ERR! code EACCES
  npm ERR! errno 3
  
  npm ERR! Error: EACCES, unlink '/usr/bin/npm'
  npm ERR!  { [Error: EACCES, unlink '/usr/bin/npm'] errno: 3, code: 'EACCES', path: '/usr/bin/npm' }
  npm ERR! 
  npm ERR! Please try running this command again as root/Administrator.
  npm ERR! error rolling back Error: EACCES, unlink '/usr/bin/npm'
  npm ERR! error rolling back  { [Error: EACCES, unlink '/usr/bin/npm'] errno: 3, code: 'EACCES', path: '/usr/bin/npm' }
  
  npm ERR! Please include the following file with any support request:
  npm ERR!     /tmp/npm.14799/package/npm-debug.log
  It failed
  </code></pre>
  
  <p>In Both cases i was unable to get install npm please guide me thanks</p>