Newman is a Node.js package. You install it via npm. If you have Node.js on your machine, you are 30 seconds away from running your first collection.
Newman requires Node.js 16 or higher. Most CI/CD servers already have Node.js. On your local machine, install Node.js from nodejs.org if you do not have it. Check your version first.
# Check if Node.js is installed
node --version
# Should show v16.x.x or higher
# Check npm
npm --versionInstall Newman globally so you can run it from any directory. The -g flag means "global."
# Install Newman globally
npm install -g newman
# Verify installation
newman --version
# Should show something like 6.x.x
# Check available commands
newman --helpOn macOS/Linux, you might get EACCES permission errors with global installs. Two fixes: either use sudo (sudo npm install -g newman) or better — configure npm to use a local directory. Run: npm config set prefix ~/.npm-global and add ~/.npm-global/bin to your PATH.
For team projects and CI/CD, install Newman as a dev dependency in your project. This locks the version. Everyone uses the same Newman version. No surprises.
# Initialize a project (if you do not have package.json)
npm init -y
# Install Newman as dev dependency
npm install --save-dev newman
# Run via npx (no global install needed)
npx newman --version
npx newman run my-collection.jsonFor CI/CD pipelines, always use local install. Your pipeline runs npm install and gets the exact Newman version your team tested with. Global installs on CI servers are unpredictable — the version might change overnight.
Q: Should you install Newman globally or locally? What is the difference?
A: For personal use and quick testing, global install (npm install -g newman) is fine — you can run newman from any directory. For team projects and CI/CD, local install (npm install --save-dev newman) is better because the version is locked in package-lock.json. Every team member and every CI run uses the exact same version. In CI/CD, you run it via npx newman run ... after npm install. The golden rule: if it goes into a pipeline, install it locally.
Key Point: Install globally for personal use (npm install -g newman), locally for teams and CI/CD (npm install --save-dev newman). Always verify with newman --version.