Most of the coding work we do at Learners Guild will be driven by the back-end web development framework Express. We'll install Express individually in each project we create. For now, we'll install the other tools we'll use along with Express.
- Install Node.js, a platform for back-end web development with the JavaScript programming language.
- Install PostgreSQL, the database we'll use with our Node.js and Express stack.
Note: when copying the code snippets, please exclude the $ as you paste and run the code into your terminal. The dollar sign $ is simply an indicator of the logged-in user's terminal prompt in the examples.
- Install Node.js with Homebrew by running the following command in the Terminal:
$ brew install node-
Run the Terminal command
node -vto check that Node.js was installed. It should print a version number greater than or equal to "v5.8.0". The Terminal commandnodechanges your Terminal into a Javascript REPL ("Read Evaluate Print Loop"), like the right-hand side of repl.it. Use the shortcutctrl + c, or type.exitto quit out of the REPL and return to the normal Terminal prompt. -
Run the Terminal command
which npmto check that NPM is installed. The Node Package Manager, used through variousnpmcommands, is a lot like Homebrew, except we'll use it for Node.js-specific tools instead of for general Mac tools. NPM packages are often called "node modules."
Nodemon (short for "node monitor") will make our Node.js workflow more efficient.
- Install nodemon globally with the following Terminal command:
$ npm install -g nodemon- Install postgres via Homebrew
$ brew install postgres- Configure postgres to start when the system does.
$ mkdir -p ~/Library/LaunchAgents
$ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents-
Check that your install worked
$ which psql
If it worked, you should see
/usr/local/bin/psqlas the terminal output.
- Set up your Node.js environment
- Install Development Tools