This guide walks through setting up a TypeScript kernel for Jupyter notebooks in this repository.
- Node.js (via nvm) with npm
- Python 3.x available on system
- Jupyter (will be installed in venv)
Create an isolated Python environment to avoid system-wide package pollution:
macOS/Linux (Bash):
python3 -m venv venv
source venv/bin/activateWindows (PowerShell):
python -m venv venv
venv\Scripts\Activate.ps1If you get an execution policy error on PowerShell, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserWindows (Command Prompt):
python -m venv venv
venv\Scripts\activate.batWith the venv activated:
pip install --quiet jupyter notebookInstall Node.js dependencies globally (if not already done):
npm install -g tslabFind the exact path to tslab:
macOS/Linux:
npm list -g tslabWindows (PowerShell or Command Prompt):
npm list -g tslabYou'll see output like:
/Users/username/.nvm/versions/node/v24.9.0/lib/node_modules/tslab
# or on Windows:
# C:\Users\username\AppData\Roaming\npm\node_modules\tslab
Register the TypeScript kernel with Jupyter:
macOS/Linux (Bash):
source venv/bin/activate
python3 /path/to/tslab/python/install.py --userWindows (PowerShell):
venv\Scripts\Activate.ps1
python C:\path\to\tslab\python\install.py --userReplace /path/to/tslab or C:\path\to\tslab with the actual path from npm list -g tslab above.
macOS/Linux (Bash):
source venv/bin/activate
jupyter kernelspec listWindows (PowerShell):
venv\Scripts\Activate.ps1
jupyter kernelspec listYou should see tslab in the output:
Available kernels:
tslab /path/to/kernel/spec
python3 /path/to/kernel/spec
...
macOS/Linux (Bash):
source venv/bin/activate
jupyter notebookWindows (PowerShell):
venv\Scripts\Activate.ps1
jupyter notebookThis opens a browser tab showing the notebook interface.