Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 18, 2021 02:02 am GMT

How to prepare a Node.js dev environment on MacOS

You will need node (required), git (optional), and yarn (optional) to develop Node applications. I also use an optional package manager, homebrew to install these tools.

To check whether you already have these tools, you can run:

  • brew -v
  • node -v
  • yarn -v
  • git --version

If these commands each output a version number, you already have the tools installed and you are ready to go.

Homebrew

Homebrew is an extremely useful package manager for Mac. To install it, run the following:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Node.js

Node.js is a Javascript runtime that executes in a server environment.

Install Node.js if you don't already have it. On Mac, you can easily install it using the Homebrew package manager (or from the project website):

brew install node

Git

Git is a version control system that allows you to store your code in a centralized repository that tracks your changes and can easily be backed up remotely to a service like Github.

You can install Git on Mac using Homebrew (or from the project website):

brew install git

Go ahead and configure your git identity:

git config --global user.name "YOUR NAME"git config --global user.email "YOUR EMAIL"

Yarn

I prefer to use the Yarn package manager for Node, instead of NPM (which is the default package manager that comes installed with Node).

Again, on Mac you can install it using Homebrew (or from the project website):

brew install yarn

All set!

You're ready to start developing Node applications on MacOS! The only other thing you will need is a text/code editor, if you don't already have one. I use vscode, but you can use any editor you like.


Original Link: https://dev.to/joncodes/how-to-prepare-a-node-js-dev-environment-on-macos-2la5

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To