Serverless Framework "Serverless plugin ... not found" in CI
Serverless loads each plugin listed under plugins: from node_modules. One is not installed in CI, so loading the config fails before any deploy work begins.
What this error means
serverless deploy fails with "Serverless plugin \"serverless-esbuild\" not found. Make sure it's installed and listed in the \"plugins\" section of your serverless config file." even though it works locally.
Error:
Serverless plugin "serverless-esbuild" not found. Make sure it's installed and listed
in the "plugins" section of your serverless config file.Common causes
Dependencies were not installed in CI
The job ran serverless without npm ci, so the plugin package is absent from node_modules.
The plugin is not a project dependency
The plugin is listed in plugins: but not in package.json, so a clean install never fetches it.
How to fix it
Install dependencies before deploy
- Add the plugin to package.json devDependencies.
- Run
npm ciin the job before serverless. - Re-run; the plugin loads from node_modules.
npm ci
npx serverless deploy --stage prodAdd the plugin to package.json
Ensure every plugin under plugins: is a declared dependency so clean installs fetch it.
npm install --save-dev serverless-esbuildHow to prevent it
- Keep every
plugins:entry in package.json. - Run
npm cibefore serverless in CI. - Commit the lockfile so plugin versions are reproducible.