semantic-release "Cannot find module '@semantic-release/...'" plugin in CI
semantic-release loads each plugin named in its config. If a plugin like @semantic-release/git or @semantic-release/changelog is referenced but not installed, Node cannot resolve it and the run fails with "Cannot find module".
What this error means
The run fails at startup with "Cannot find module '@semantic-release/git'" or "Cannot find package" for a plugin listed in the config.
[semantic-release] > Error: Cannot find module '@semantic-release/git'
Require stack:
- /home/runner/work/app/node_modules/semantic-release/index.jsCommon causes
A non-default plugin is not in devDependencies
Plugins beyond the default set (git, changelog, exec) must be installed explicitly; the config references one that was never added.
The install step skipped dev dependencies
The job ran npm ci --omit=dev or --production, so the release plugins in devDependencies were not installed.
How to fix it
Install the referenced plugin
- Add each non-default plugin to devDependencies.
- Run a full install (not production-only) in the release job.
- Re-run so all configured plugins resolve.
npm install --save-dev @semantic-release/git @semantic-release/changelogDo not omit dev dependencies in the release job
Ensure the install includes devDependencies so the plugins are present.
- run: npm ciHow to prevent it
- Add every configured plugin to devDependencies.
- Use
npm ci(with dev deps) in the release job. - Pin plugin versions alongside the semantic-release version.