title: Error: EACCES: permission denied, unlink '/usr/local/bin/npm
body: <p>First and foremost I have looked into these previous post for answers: <a href="https://stackoverflow.com/questions/45166318/eacces-permission-denied-unlink">EACCES: permission denied, unlink</a></p>
  
  <p><a href="https://stackoverflow.com/questions/57814364/error-eacces-permission-denied-unlink-usr-local-bin-npx">Error: EACCES: permission denied, unlink &#39;/usr/local/bin/npx&#39;</a></p>
  
  <p><a href="https://stackoverflow.com/questions/54199698/error-while-building-or-running-ngx-bootstrap-tests">Error while building or running ngx-bootstrap tests</a></p>
  
  <p>I do not see the answers I seek in any of these posts, or maybe I am not knowledgable enough to decipher how to use those answers to fix my issue. I am still learning so please, if you are answering my post make sure you explain, so that I may fully grasp what is being done and why. I would appreciate it very much.  </p>
  
  <p>In VS Code I was trying to work on a project but needed to update the npm version. See example:</p>
  
  <p><a href="https://i.stack.imgur.com/rqFeJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rqFeJ.png" alt="VSCode npm update error"></a></p>
  
  <p>After researching the f***(pardon my language) out of this, I did the following:</p>
  
  <p>after reading this article: <a href="https://flaviocopes.com/npm-fix-missing-write-access-error/" rel="nofollow noreferrer">https://flaviocopes.com/npm-fix-missing-write-access-error/</a>
  I did what he suggested and then tried to do the npm update. </p>
  
  <p><a href="https://i.stack.imgur.com/9y5wM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9y5wM.png" alt="missing write error - fix"></a></p>
  
  <p>I then did the following, to find who owns the directory</p>
  
  <p><a href="https://i.stack.imgur.com/aQptl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aQptl.png" alt="npm error 2"></a></p>
  
  <p>After this I am pretty much at lost of what to do next, why do I have three 'drwxr-xr-x'? what does that exactly mean, that I have three npm packages? can I combine them all into one? or would it be better to delete all and start from scratch, but would I run into the same issue?</p>
  
  <p>I also read this: </p>
  
  <blockquote>
    <p>To minimize the chance of permissions errors, you can configure npm to
    use a different directory. In this example, you will create and use a
    hidden directory in your home directory.</p>
    
    <p>Back up your computer. On the command line, in your home directory,
    create a directory for global installations: mkdir ~/.npm-global
    Configure npm to use the new directory path: npm config set prefix
    '~/.npm-global' In your preferred text editor, open or create a
    ~/.profile file and add this line: export PATH=~/.npm-global/bin:$PATH
    On the command line, update your system variables: source ~/.profile
    To test your new configuration, install a package globally without
    using sudo</p>
  </blockquote>
  
  <p>but will that work if I have to [unlink '/usr/local/bin/npm'], according to the terminal. In all honestly, I prefer not reconfigure as I would need to back up everything, does anyone have a solution or suggestion as to what to do? </p>
  
  <p>Thank you all in advance. And again I would like to reiterate that I am still learning, so please be kind and elaborate on your answer.</p>