PortGate

Blueprints · Node.js & Next.js

Beginner 10 min · Node.js

npm ci from the lockfile

Stages an install that uses npm ci so production matches the lockfile.

Live config

Baked-in protections

Step 1 · bash

Install script

/opt/app/npm-ci.sh

Run from the application directory during a deploy.

#!/bin/sh
set -eu
cd "/opt/app"
npm ci

Step 2 · bash

Read-only check

/root/portgate-blueprints/npm-lock-check.sh

Prints status. It does not change the service.

#!/bin/sh
set -eu
if [ -f "/opt/app/package-lock.json" ]; then
  echo "package-lock.json is present."
else
  echo "package-lock.json is missing."
fi