Tsallaka zuwa abun ciki
Justice Tech School

npm Scripts and Versions

Scripts in package.json run with npm run name. Version ranges use semver: ^1.2.3 allows minor and patch updates, ~1.2.3 allows patches only. package-lock.json pins exact versions.

Example
{
  "scripts": {
    "start": "node server.js",
    "test": "node --test",
    "dev": "node --watch server.js"
  },
  "dependencies": { "express": "^4.19.0" }
}
// npm run dev
// npm install --save-dev eslint

Exercise

Run a script.

npm  dev

Quiz Test

What does ^1.2.3 allow?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.