Lesson

Setup local Verdaccio server to release NPM packages

Learn how to spin up a local NPM registry powered by Verdaccio to test deploy your NPM packages.

Access
Free
Transcript
Available

Verdaccio is a fully featured NPM registry that you can run locally on your machine. It’s a great tool for testing your release process, running end-to-end tests, and simulating real-world scenarios like deploying packages, installing them, and verifying functionality as an end user would.

Nx includes a generator that simplifies setting up Verdaccio. To configure it, run:

Terminal
npx nx g @nx/js:setup-verdaccio   

This command installs the necessary NPM packages and creates a project.json file with a local-registry target. To start the local registry, open a new terminal window and run:

Terminal
npx nx local-registry

This will:

  • Launch the Verdaccio registry.
  • Configure NPM to point to the local Verdaccio server at http://localhost:4873.

Note: A project.json file provides an advanced way to define scripts, offering more flexibility than a traditional package.json for managing complex targets.