Untitled Lesson
Skill Matrix
UNLOCK NODES BY LEARNING NEW TAGS.
When you install an external library using NPM, in which automatically generated folder does the code get physically saved (and which you must add to .gitignore)?
💻 Code Challenge | +75 XP
Write the Node.js/Backend code snippet to implement a NPM and Dependencies pipeline. Include the setup and basic execution steps.
You are reviewing a NPM and Dependencies pipeline and the output is incorrect. Reorder the following pipeline stages in the correct logical order to fix the bug: Input Data, Process, Output.
Task: Reorder the blocks in logical sequence to solve the problem.
A.D.A. Interface
Adaptive Didactic Assistant

Pascual Vila
Frontend Instructor // Code Syllabus
The Error //
Committing package-lock.json to be ignored or regenerated inconsistently across a team
// Wrong: .gitignore excludes the lockfile
node_modules/
package-lock.json
// Correct: only ignore node_modules, commit the lockfile
node_modules/The Solution //
package.json only records loose version ranges (e.g. ^4.18.0), so without package-lock.json committed to Git, different developers (and your CI/production server) can silently install different exact sub-dependency versions, causing 'works on my machine' bugs. Always commit package-lock.json and use `npm ci` (not `npm install`) in CI/production, since npm ci installs the exact locked versions and fails if the lockfile is out of sync.
The Error //
Installing a build/test-only tool as a regular dependency instead of a devDependency
// Wrong: testing tool ends up in production dependencies
npm install jest
// Correct: -D flags it as a dev-only dependency
npm install -D jestThe Solution //
Running `npm install jest` (without -D) adds it to "dependencies" instead of "devDependencies". When a production deploy runs `npm install --omit=dev`, tools correctly flagged as dev dependencies are skipped, keeping the image small — but a testing/linting tool mistakenly listed under dependencies gets installed in production anyway, bloating the deployment and increasing attack surface.