NPM Dependency Management: package.json vs package-lock.json | NodeFlux.eu Docs

Avoid production deployment crashes by managing NPM dependency trees cleanly with lockfiles.

Steps

  1. Always generate package-lock.json locally before deploying by running npm install.
  2. Commit package-lock.json along with package.json in your project repository or upload payload.
  3. Never upload node_modules folder over SFTP; let NodeFlux install dependencies on the target container.
  4. Use npm ci instead of npm install in server startup scripts for reproducible, faster dependency builds.
  5. Audit dependencies locally using npm audit to identify and patch security vulnerabilities.

Notes