Skip to content

Latest commit

 

History

History
103 lines (74 loc) · 2.81 KB

windows-powershell-install-chocolatey.md

File metadata and controls

103 lines (74 loc) · 2.81 KB

Windows Powershell install Chocolatey

Following these Instructions results:

  • Installing
    • Chocolatey; software installation manager
    • fnm; Node version manager built in Rust
    • Git; Version Control System
    • Git BASH; bash emulation for *NIX-like usage
    • Node.js; LTS version of JavaScript Runtime environment
    • VSCode; neat web development code editor
  • adding files to HOME Directory:
    • ~/.bash_profile
    • ~/.bashrc
    • ~/.node-version

Download Chocolatey to simplify installing software.

To Install Chocolatey, you must...

Open Windows Powershell as Administrator

  1. Click Windows Button
  2. Type powershell
  3. Click ctrl + shift + enter
  4. Choose Yes

At this point, you should be in a window that says Administrator: Windows Powershell

  1. Type cd $HOME or cd ~ and then click enter to change to your user directory

Install Chocolatey

You must be in Windows Powershell as Administrator to do the following steps:

  1. Copy & Paste the following:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

more info here

  1. Click enter
  2. Wait until complete
  3. After waiting, type choco --help and then click enter -- this should output the information on chocolatey commands

choco install all the software

Open Windows Powershell as Administrator and have Chocolatey installed to easily install multiple software programs

  1. Copy & Paste the following:
choco install git fnm vscode -y
  1. Click enter
  2. Wait until complete... may need to hit enter a bunch of times...
  3. After it is complete, type exit and then click enter
  4. open powershell
  5. type git and then click enter -- it should return information about git

Use fnm to manage node versions

Setup fnm using choco

choco install fnm -y

Run this process in Git Bash as Administrator.

Setup Environment shellscript

# start at the $HOME directory
cd ~

# override variable outputs into file .bashrc
fnm env > ~/.bashrc

echo '
eval "$(fnm env --use-on-cd --shell bash)"
' >> ~/.bashrc

# Git Bash requires .bash_profile to utilize .bashrc
echo "# generated by Git for Windows" > ~/.bash_profile

echo '
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
' >> ~/.bash_profile

# install and use latest lts
fnm install lts-latest
fnm use lts-latest
fnm default lts-latest

# use the settings
echo run bash_profile
. ~/.bash_profile

# node at LTS
node -v > ~/.node-version