Installation
Requirements
- Node.js 18.0.0 or later (Node.js 22 LTS recommended)
- npm (bundled with Node.js)
Install as a dev dependency
The recommended approach is to install JSDoc locally in your project so every contributor uses the same version:
Run this in your project root
npm install --save-dev jsdocThen add a script to package.json:
{
"scripts": {
"docs": "jsdoc -r src -d docs"
}
}
Run it with:
npm run docs
Install globally
If you prefer to call jsdoc directly from any terminal:
npm install -g jsdoc
warning
Global installs can cause version mismatches between team members. A local dev dependency is preferred for collaborative projects.
Verify the installation
npx jsdoc --version
# JSDoc 4.0.5
Next steps
With JSDoc installed, head to the Quickstart to generate your first documentation site.
Official reference: Official JSDoc documentation