What does ^7.9.0 in package.json allow?
A teaching copy of the rule, checked against npm's own semver library for these nine pairs. It leaves out pre-release versions and ^0.0.x.
A page you double-click cannot read data files or import its own code, because the browser treats file:// pages as unsafe. A small local server (Vite, run by Node) fixes that, and npm fetches D3 for you. This topic sets up the project the rest of the course uses.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write the exact terminal commands, in order, that take you from an empty folder to a running dashboard project with D3 installed. Then say which of them you would run again on a teammate's computer that already has your package.json and src/.
A teammate sends you a zip of the project that includes node_modules (tens of megabytes for this project, often far more). What do you do, and what do you tell them to send next time?
Explain it without notes
Why does fetch("data.csv") work from npm run dev but not from a double-clicked page?
What is the difference between package.json, package-lock.json and node_modules?
What does the ^ in "d3": "^7.9.0" mean, and why does it not accept 8.0.0?
Preview
Console
Nothing logged yet.Expected console output
^7.9.0 7.9.0 allowed
^7.9.0 7.10.2 allowed
^7.9.0 8.0.0 refused
^7.9.0 7.8.9 refused
~7.9.0 7.9.5 allowed
~7.9.0 7.10.0 refused
7.9.0 7.9.1 refused
^0.2.3 0.2.9 allowed
^0.2.3 0.3.0 refused