A useful debugging result starts with an identifiable environment. In this lesson you will create a local Aster Service Desk client, identify its tools and source inputs, build it and inspect it in a browser. You will also recover from an engine mismatch and an occupied port without changing global settings or stopping someone else's process.
Allow about 40–65 minutes including downloads and your own diagnosis. This
reference walkthrough was checked on macOS 15.7.9, arm64, zsh, with Node
24.19.0 and npm 12.2.1. Windows/Linux commands and other host combinations are
not qualified here. You need a writable new directory, a browser, access to
nodejs.org and registry.npmjs.org, and room for tools, dependencies and cache.
Five GB free disk is a planning allowance, not a measured minimum. No global
CLI, administrator command, cloud account or paid backend is required.
Complete the readiness lesson first. The starter supplies every application file; you are not expected to invent a configuration or clone a private repo. This lesson starts only the client development server. The synthetic API, instance identity and fixture controls are introduced in lesson 03.
Separate inputs from evidence
| Check | What a successful result establishes |
|---|---|
| Download checksum | The bytes match the expected artifact digest; it is not a signature or a runtime result. |
| Local tool versions | The selected executables report the required Node/npm versions. |
| Locked install | This environment installed the supplied dependency graph under the stated policy. |
| Workspace doctor | This root, manifest/lock bytes and four installed package versions match the starter checks. |
| Build | The selected Angular builder compiled this client configuration. |
| Browser inspection | The client actually rendered the expected heading/checkpoint at the owned URL. |
Keep these observations distinct. Installing dependencies does not prove that the client renders, that an API is connected or that the later course outcomes work. A development server is not a cloud deployment or SSR check.
Extract into a new directory you own
Use Aster foundations — workspace-02 in this lesson's Practice files panel.
Save aster-foundations.zip; compare its SHA-256 with the checksum shown for
that download. The panel is the source of the current packet checksum, so a
later course update does not require guessing which file you received.
In one zsh terminal, check the platform and built-in tools:
uname -s
uname -m
sw_vers -productVersion
command -v curl tar ditto shasum lsof
The reference architecture is arm64 on Darwin. If your platform or a required
tool differs, stop before applying these platform-specific commands and use a
qualified environment. Do not solve a corporate network restriction by disabling
TLS checks or inserting private credentials into the starter.
Choose a new parent directory. The name below is a safe example; if it already exists, choose another name instead of overwriting it. Adjust the ZIP path if your browser saved elsewhere. Every quoted variable is a path supplied here, not a command to obtain from an unknown helper.
ASTER_PACKET="$HOME/Downloads/aster-foundations.zip"
shasum -a 256 "$ASTER_PACKET"
Compare that result with the Practice files panel before extraction. Stop on a mismatch and obtain the intended download. After the digest matches, choose and create the new parent:
ASTER_STUDY="$HOME/aster-angular-02"
mkdir "$ASTER_STUDY" &&
ditto -x -k "$ASTER_PACKET" "$ASTER_STUDY" &&
cd "$ASTER_STUDY/aster-foundations" &&
ASTER_LAB="$(pwd -P)" &&
printf 'Workspace: %s\n' "$ASTER_LAB"
The && connections stop dependent commands if the previous command fails.
mkdir deliberately fails for an existing parent; choose another new parent
instead of extracting over existing work. ditto extracts the ZIP's
aster-foundations/ top folder under that parent. pwd -P resolves the workspace
location rather than leaving a symlink alias in our recorded path. These shell
variables last only in this terminal session.
The starter contains:
| Files | Responsibility |
|---|---|
package.json, package-lock.json | Exact direct pins plus the complete resolved dependency graph/integrities. |
.aster-lab.json | Course/packet/checkpoint identity and hashes of those two input files. |
angular.json, tsconfig*.json | Local build/serve targets and strict TypeScript/template checking. |
src/ | The complete original client baseline, including its HTML and styles. |
lab/identity.mjs, doctor.mjs, start.mjs | Explained root/version/byte checks and an owned foreground launch. |
practice/engine-mismatch/ | A separate deliberately incompatible input for your diagnosis task. |
There is no API fixture or checkpoint/reset helper to operate yet. The supplied launch/check scripts below are explained before their first use.
Understand the pins and lock
The four central application/tool pins are Angular framework 22.2.3, CLI/build 22.2.5, TypeScript 6.0.3 and RxJS 7.8.2. Other exact direct dependencies are listed in the complete manifest for later lessons. Their installation does not qualify their future workflows. Tooling and framework patch numbers need not be identical; their actual peer requirements and checked combination matter.
The selected compiler's TypeScript requirement is >=6.0 <6.1. Version 6.0.3
fits; a 7.x candidate does not. “Newer” is not a compatibility argument. Do not
bypass that mismatch with --force, --legacy-peer-deps or disabled checking.
The manifest identifies direct requirements and scripts. The lock also records
transitive resolutions and integrity values; exact direct pins alone cannot
replace it. This starter's lock is complete compact JSON, not a shortened graph.
Whitespace changes its byte hash even if its JSON meaning stays the same.
Keep the supplied lock for this checkpoint and use npm ci, rather than
regenerating it as a routine response to an unexplained error.
The manifest's engines fields select Node 24.19.0/npm 12.2.1. We additionally use
--engine-strict during installation: the declaration alone is not the same as
enforcing it. packageManager records the chosen manager; the explicit CLI
path and its observed version are still checked below.
Install the tools locally
Keep tools and cache beside the application under your new parent:
ASTER_TOOLS="$ASTER_STUDY/tools"
ASTER_CACHE="$ASTER_STUDY/cache/npm"
mkdir "$ASTER_TOOLS"
mkdir -p "$ASTER_CACHE"
ASTER_STUDY is your owned parent; ASTER_LAB is the app root; ASTER_TOOLS
contains downloaded executables; ASTER_CACHE holds this exercise's npm cache.
None of these variables repurposes a global tool directory.
Download the pinned darwin-arm64 Node archive. The following digest is the
recorded SHA-256 from Node's 24.19.0 release checksums. The curl options fail on
HTTP errors, follow redirects and keep HTTPS/TLS verification. shasum -c
must report OK before the archive is extracted.
curl --fail --location --proto '=https' --tlsv1.2 \
--output "$ASTER_TOOLS/node-v24.19.0-darwin-arm64.tar.gz" \
'https://nodejs.org/dist/v24.19.0/node-v24.19.0-darwin-arm64.tar.gz' &&
printf '%s %s\n' '8294b7aa9b03997481c06babf1e8b270c859358f27da57a11509afe537ac381d' "$ASTER_TOOLS/node-v24.19.0-darwin-arm64.tar.gz" | shasum -a 256 -c - &&
tar -xzf "$ASTER_TOOLS/node-v24.19.0-darwin-arm64.tar.gz" -C "$ASTER_TOOLS" &&
ASTER_NODE_HOME="$ASTER_TOOLS/node-v24.19.0-darwin-arm64" &&
ASTER_NODE="$ASTER_NODE_HOME/bin/node" &&
"$ASTER_NODE" --version
The expected version is v24.19.0. The Node archive contains a bundled npm, but
this reference uses a separately selected npm 12.2.1 CLI so its version is
explicit rather than whichever npm happens to be on your path. The next
SHA-512 is the hexadecimal form of the pinned npm registry artifact's recorded
integrity digest. This is a byte comparison, not an independent publisher
signature.
curl --fail --location --proto '=https' --tlsv1.2 \
--output "$ASTER_TOOLS/npm-12.2.1.tgz" \
'https://registry.npmjs.org/npm/-/npm-12.2.1.tgz' &&
printf '%s %s\n' '6ca0a6151553fc107e60f1186d9c10d57508dcde6de31292a54d4cc4e8e8ef3de25b3281274657442d7115d10df930bb3794ddcb0681cdfd9d317189abf7b63d' "$ASTER_TOOLS/npm-12.2.1.tgz" | shasum -a 512 -c - &&
mkdir "$ASTER_TOOLS/npm" &&
tar -xzf "$ASTER_TOOLS/npm-12.2.1.tgz" -C "$ASTER_TOOLS/npm" &&
ASTER_NPM_CLI="$ASTER_TOOLS/npm/package/bin/npm-cli.js" &&
"$ASTER_NODE" "$ASTER_NPM_CLI" --cache "$ASTER_CACHE" --version
The expected result is 12.2.1. Stop on a checksum or version mismatch. These
commands neither install globally nor modify your shell startup files. In the
commands below, PATH=... applies only to that invocation and its children;
it lets package scripts find this Node while the npm CLI itself is called by
its exact file path.
Perform the locked install and identify the workspace
From ASTER_LAB, run:
cd "$ASTER_LAB"
PATH="$ASTER_NODE_HOME/bin:$PATH" "$ASTER_NODE" "$ASTER_NPM_CLI" ci \
--engine-strict --ignore-scripts --no-audit --no-fund --cache "$ASTER_CACHE"
PATH="$ASTER_NODE_HOME/bin:$PATH" "$ASTER_NODE" "$ASTER_NPM_CLI" --cache "$ASTER_CACHE" run doctor
ci requires matching manifest/lock dependency inputs and replaces an existing
node_modules tree. Use it only in this owned workspace, where dependencies
are generated rather than your edited source. The install ignores lifecycle
scripts; this checked macOS/arm64 combination uses its available prebuilt tools.
The later run doctor, run build and run start are deliberate invocations
of the starter's named scripts. The audit/funding options avoid unrelated
requests/messages; no vulnerability assessment is implied.
The doctor uses the actual native files in the packet. This is the complete
.aster-lab.json input for this checkpoint:
{
"course_id": "advanced-angular",
"packet_id": "aster-foundations",
"checkpoint": "workspace-02",
"manifest_sha256": "ff9bfcd6d85c7eba6746cef8bca3a3ded862ddfcf48181cfeb35801f4249a6f9",
"lock_sha256": "ef9afb57b7c2baa40a4d309a25717bd250562d526cbe40c755cc1a2b59076666"
}
The marker identifies this starter and its input hashes; it is not permission to remove an arbitrary directory. The downloaded ZIP digest establishes which packet you obtained. The marker then helps detect mixed, edited or reformatted manifest/lock bytes within it.
In lab/identity.mjs, the root is derived from the supplied script's own
location and resolved with realpathSync. Its comparison with the actual
working directory prevents that script from checking a different root.
readJson reads the named local JSON files; digest uses SHA-256 over their
bytes. The check validates marker identity, the running Node version and the
npm version read beside the CLI path supplied by this pinned npm run
invocation. It compares manifest/lock hashes and reads four installed package
manifests under this root's node_modules.
lab/doctor.mjs prints the resulting report or exits nonzero with a specific
failure. It is not a general semver resolver or a guarantee about arbitrary
external tools. An illustrative report excerpt is:
status: workspace-inputs-ok
root: /Users/learner/aster-angular-02/aster-foundations
checkpoint: workspace-02
node: 24.19.0
npm: 12.2.1
installed: @angular/core 22.2.3, @angular/cli 22.2.5, typescript 6.0.3, rxjs 7.8.2
Actual paths, hashes and JSON formatting come from your report. Inspect the
node_binary and npm_cli fields as well as versions; a global executable with
a familiar name is not proof that you selected these local paths. If only
whitespace changed the lock, do not remove the byte check or silently update
the marker. Preserve your edits and compare with the intended downloaded
checkpoint before continuing.
Build the client and inspect its source boundary
PATH="$ASTER_NODE_HOME/bin:$PATH" "$ASTER_NODE" "$ASTER_NPM_CLI" --cache "$ASTER_CACHE" run build
package.json maps build to the local Angular CLI. angular.json selects
@angular/build:application, src/main.ts, the app TypeScript configuration
and supplied styles. Its default production target writes to
dist/aster-foundations/browser; its separate development serve target is used
below. This configuration does not set up SSR or an API.
The complete src/main.ts is:
import { bootstrapApplication } from '@angular/platform-browser';
import { App } from './app/app';
bootstrapApplication(App).catch(error => console.error(error));
It imports the supplied component, asks Angular to bootstrap it and reports a
bootstrap error. src/index.html supplies the aster-root host element.
src/app/app.ts declares that selector, its template/styles and two readonly
display fields. app.html renders the heading and workspace-02 checkpoint.
These are baseline component concepts from your prerequisites; more deliberate
component contracts are taught later. The TypeScript configuration keeps
strict and strictTemplates enabled instead of concealing errors.
A successful build establishes compilation of these inputs. Inspect the emitted files, then verify actual rendering rather than inferring it from command exit.
Start at a checked loopback port
Choose an unused unprivileged port. 4317 is an example, not a reserved port.
The inspection command is read-only:
ASTER_PORT=4317
lsof -nP -iTCP:"$ASTER_PORT" -sTCP:LISTEN
If a listener appears and you do not identify it as your own launch, leave it running and choose another port. Do not terminate a PID simply because you want its port. With the chosen value:
ASTER_PORT="$ASTER_PORT" PATH="$ASTER_NODE_HOME/bin:$PATH" \
"$ASTER_NODE" "$ASTER_NPM_CLI" --cache "$ASTER_CACHE" run start
lab/start.mjs first performs the same workspace checks. It accepts only a
whole-number ASTER_PORT from 1024 through 65535, tries a temporary exclusive
bind on 127.0.0.1 and closes that probe. An occupied port produces a nonzero
result before Angular launches; nothing owning the port is stopped.
The check is a point-in-time observation, not a reservation. The child still must bind that exact port. This excerpt from the supplied launch script shows the important boundary; the complete file contains the checks and signal handling around it:
const child = spawn(process.execPath, [resolve(workspace.root, 'node_modules/@angular/cli/bin/ng.js'), 'serve', '--host', '127.0.0.1', '--port', String(port), '--open=false'], {
cwd: workspace.root,
stdio: ['ignore', 'inherit', 'inherit'],
env: { ...process.env, CI: 'true', PORT: String(port) },
});
spawn uses an argument array, the selected Node executable and this workspace's
CLI. It runs in the checked root, with no browser popup. The child's PORT
explicitly matches the validated port because Angular documents that environment
variable as taking precedence over --port. It does not change your parent
shell's PORT or another process's environment. The child requests noninteractive
operation; a bind/startup failure is not permission to accept an unrelated URL.
The initial “Starting Aster…” message is not readiness proof. Wait for the CLI
output, then open the exact http://127.0.0.1:<chosen-port>/ URL. Replace
<chosen-port> with your number. Verify all of these observations:
- The page heading is Aster Service Desk.
- The page says Workspace baseline ready and checkpoint workspace-02.
- The browser console has no bootstrap error.
- This is the client baseline; no API records or SSR behavior are claimed.
Stop this foreground launch with Ctrl+C in its own terminal. The script relays interruption/termination to the Angular child it created; it never uses a broad process-name kill. An interruption exit such as 130 is expected when you deliberately stop it. Reinspect the chosen port; if a different owner appears later, do not stop it. Continue with the exercises after your launch ends.
Diagnose two independent cases
Task 1: the engine declaration does not fit
The packet's practice/engine-mismatch/ contains a separate no-dependency
manifest and complete lock. Its deliberate node: >=99 declaration conflicts
with the selected runtime. Do not copy it over the app manifest.
cd "$ASTER_LAB/practice/engine-mismatch"
PATH="$ASTER_NODE_HOME/bin:$PATH" "$ASTER_NODE" "$ASTER_NPM_CLI" ci \
--engine-strict --ignore-scripts --no-audit --no-fund --cache "$ASTER_CACHE"
Expect a nonzero EBADENGINE result. Identify the conflicting field, repair only
this practice case to use the selected Node pin, and rerun the same command.
What would --force hide rather than fix?
Hint 1: compare the declared engine with "$ASTER_NODE" --version.
Hint 2: keep the case's root engine metadata consistent in both supplied JSON files.
Answer and reasoning
In the case's package.json, change engines.node from >=99 to 24.19.0.
Make the same change at packages[""].engines.node in its lock; keep npm 12.2.1.
These are complete supplied files, so no dependency data needs to be guessed.
The rerun should exit 0. This tiny case demonstrates engine compatibility, not a
successful Angular build. Bypassing the engine policy would erase evidence of
the mismatch. Return to the actual app root:
cd "$ASTER_LAB"
The app's manifest/lock and marker were not changed. The TypeScript worked
comparison above is similar reasoning: a 7.x pin remains outside >=6.0 <6.1
even if you regenerate a lock or suppress a diagnostic.
Task 2: the chosen port already has an owner
Start your Aster client again in terminal A. In a second terminal B, recreate the
path variables for this same existing workspace using the resumption block
below; do not extract over it. Attempt run start with the same ASTER_PORT.
Predict the result, verify that terminal A's client remains available, then choose
another unused port for terminal B. Keep track of which two launches you own.
Hint 1: an occupied-port diagnostic is not a request to kill the owner.
Hint 2: change the second invocation's ASTER_PORT, then inspect its exact URL;
the child override prevents an inherited PORT from silently redirecting it.
Answer and reasoning
The second same-port launch should fail before Angular starts and say the port
is occupied. The first instance should continue to respond. After checking an
alternative such as 4318, use that value for terminal B and verify its explicit
URL/checkpoint. Stop terminal B's launch and then terminal A's, each with Ctrl+C in
its own foreground terminal. Do not run a blanket killall, pkill or a kill
against an unidentified PID. Different valid unused port choices are acceptable.
Resume and clean up deliberately
A new terminal does not inherit these shell variables. For the example parent used above, this block reuses the existing tools/source; it does not reinstall or re-extract. Replace the parent with the actual path you created if different.
ASTER_STUDY="$HOME/aster-angular-02"
ASTER_TOOLS="$ASTER_STUDY/tools"
ASTER_CACHE="$ASTER_STUDY/cache/npm"
ASTER_NODE_HOME="$ASTER_TOOLS/node-v24.19.0-darwin-arm64"
ASTER_NODE="$ASTER_NODE_HOME/bin/node"
ASTER_NPM_CLI="$ASTER_TOOLS/npm/package/bin/npm-cli.js"
cd "$ASTER_STUDY/aster-foundations"
ASTER_LAB="$(pwd -P)"
ASTER_PORT=4317
PATH="$ASTER_NODE_HOME/bin:$PATH" "$ASTER_NODE" "$ASTER_NPM_CLI" --cache "$ASTER_CACHE" run doctor
Recheck the chosen port before starting. If installation was interrupted and the
doctor finds missing dependencies, return to this owned root and repeat the same
locked ci command. It replaces the partial dependency tree while preserving
your source and lock; do not “repair” it by deleting the lock. A network failure
needs the approved connectivity route, not disabled TLS or different package pins.
Keep source, manifest/lock, marker, lab scripts, practice work, notes and the local tools for lesson 03. To reclaim only generated app outputs, first stop all your own launches, confirm the resolved root/marker and pass the doctor. Do not use this cleanup in an unknown directory, with changed source identity, or while an install/build/server is active. Then this guarded zsh block removes only the three generated paths; symlinked targets require inspection instead:
cd "$ASTER_LAB"
PATH="$ASTER_NODE_HOME/bin:$PATH" "$ASTER_NODE" "$ASTER_NPM_CLI" --cache "$ASTER_CACHE" run doctor &&
if [ "$(pwd -P)" = "$ASTER_LAB" ] && [ -f .aster-lab.json ] &&
[ ! -L .aster-lab.json ] && [ ! -L node_modules ] &&
[ ! -L dist ] && [ ! -L .angular ]; then
rm -rf -- ./node_modules ./dist ./.angular/cache
else
printf '%s\n' 'Cleanup checks failed; stop and inspect the owned paths.'
fi
Confirm that src, the two package files, marker and lab still exist and that
the generated paths are gone. This optional cleanup means the next resume needs
npm ci again. It does not remove your parent practice directory, npm cache or
local tools. Preserve those intentionally; do not mistake retained source/work
for a cleanup failure.
Check your understanding
Which bytes and observed version outputs identify this workspace? Explain what
would change if the lock were merely reformatted, if a global npm were called,
or if the install succeeded but the browser never rendered workspace-02.
A useful answer separates artifact bytes, tool paths/versions, installed inputs,
compilation, browser behavior and the future API fixture.
References
- Angular version compatibility and versioning; exact package pins and the actual checked install, rather than the matrix alone, establish this reference.
- Node 24.19.0 release and release checksums.
- Pinned npm metadata, npm ci and configuration/engine policy.
- Angular build, serve and strict TypeScript checking.
- Node net, child processes, process context and hashes support the supplied helpers.