title: installing NODEJS on remote AWS instance of Red Hat Enterprise Linux 7.1
body: <p>I have been trying to install NODEJS on remote AWS instance of Red Hat Enterprise Linux 7.1 </p>
  
  <p>I had read some of the posts here and been on the node js website</p>
  
  <p>I have tried t</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>curl --silent --location https://rpm.nodesource.com/setup | bash -</code></pre>
  </div>
  </div>
  </p>
  
  <p>but then get the error</p>
  
  <p>error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)</p>
  
  <p>i even get this error if i run
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>sudo curl --silent --location https://rpm.nodesource.com/setup | bash -</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have also tried to change the permissions on that file but then it still doesnt install</p>
  
  <p>Can someone suggest a better way / correct way of doing this?</p>
  
  <p>Thanks</p>