document.write("
    \n
  1. Download & Install LTS NodeJS Package from here

  2. \n
  3. Create new Directory for NPM and Global Packages:

    \n

    mkdir ~/.npm-packages

  4. \n
  5. Configure NPM to use the new directory:

    \n

    npm config set prefix ~/.npm-packages/

  6. \n
  7. Create or Modify ~/.bash_profile or ~/.zshrc and add the following:

    \n

    NOTE: Starting with macOS Catalina, ZSH will be the default shell

    \n

    NOTE: I use Visual Studio Code and have enabled Launching from the command line.

    \n

    code ~/.bash_profile or code ~/.zshrc

    \n

    Add the following line to ~/.bash_profile or ~/.zshrc

    \n
    # The next line is for running NPM \nexport PATH=~/.npm-packages/bin:$PATH\n
  8. \n
  9. Run the below command to update system variables:

    \n

    source ~/.bash_profile or source ~/.zshrc

    \n

    NOTE: I highy recommend you completely exit and restart Terminal/SecureCRT instead of running this command to ensure configuration sticks.

  10. \n
  11. Verify NPM is running in your new location:

    \n

    npm list -g -depth=0

    \n
    \n

    Output should look similar to below (emphasis added):

    \n
    \n
    JMCOMBSMBP:~ jmcombs$ npm list -g -depth=0\n\\!h /Users/jmcombs/.npm-packages/lib\n└── npm@6.9.0\n
  12. \n
  13. Upgrade NPM to the latest version

    \n
      \n
    • npm install npm -g
    • \n
  14. \n
  15. Verify NPM is latest version (at the time of writing this it is 6.9.0)

    \n

    npm list -g -depth=0

    \n
    \n

    Output should look similar to below (emphasis added):

    \n
    \n
    JMCOMBSMBP:~ jmcombs$ npm list -g -depth=0\n/Users/jmcombs/.npm-packages/lib\n└── npm@6.9.0\n
    \n

    npm -v

    \n
    \n

    Output should look similar to below (emphasis added):

    \n
    \n
    JMCOMBSMBP:~ jmcombs$ npm -v\n\\!h 6.9.0\n
  16. \n
  17. Success

  18. \n
\n

Sources used for this article:

\n\n
installing-node.md - Snippet hosted by \"Cacher\"
");