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
- npm ci requires the lockfile
- The command is staged
- npm is not run by the bundle
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