Pre-requisites

Installing required pre-requisites

NodeJS

Install latest version of NodeJS. The tested version at the time of writing this document is 16.18.1

PNPM

PNPM is a fast, efficient package manager, 2x faster than NPM.

npm install -g pnpm@6.35.0

The latest version of PNPM is 7.x but it has an issue with linking packages using pnpm link useful for local development of @logosphere libraries. Therefore it's better to stick to the latest 6.x version. The issue is logged to track this and once fixed, we should be switching to 7.x because 6.x is becoming unsupported.

Turn on peer dependencies auto-install:

pnpm config set auto-install-peers true

NX

NX is a next generation build system with first class monorepo support and powerful integrations.

pnpm install -g nx@15.4.4

PNX Alias

Try running nx command from the workspace directory and it will give you warning:

NX Running global Nx CLI with PNPM may have issues.
Prefer to use "pnpm" (https://pnpm.io/cli/exec)) to execute commands in this workspace.
TIP create a shortcut such as: alias pnx="pnpm nx --"

As it says in the tip, create a alias in your .bash_profile or .zshrc (MacOs only) depending on what shell you are using

alias pnx="pnpm nx"

Source it

$ source ~/.zshrc

Try it

$ pnx --version

Now the warning about using pnpm should be gone.

From now on, when following instructions from Nx documentation, whenever it says to use nx use pnx alias instead

Docker

Install latest version of Docker Desktop, which should include docker-compose

Last updated