Cannot redefine property: _serverlessExternalPluginName

When I run the ci/cd pipeline its giving this error
But the thing is the on retrying the previous succesfull deployments it is also giving this error

To ensure safe major version upgrades ensure "frameworkVersion" setting in service configuration (recommended setup: "frameworkVersion: ^3.39.0")
Environment: linux, node 23.0.0, framework 3.39.0, plugin 7.2.3, SDK 4.5.1
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error: TypeError: Cannot redefine property: _serverlessExternalPluginName at Function.defineProperty (<anonymous>) at PluginManager.resolveServicePlugins (/builds/node_modules/serverless/lib/classes/plugin-manager.js:230:14) at async PluginManager.loadAllPlugins (/builds/node_modules/serverless/lib/classes/plugin-manager.js:136:36) at async Serverless.init (/builds/node_modules/serverless/lib/serverless.js:146:5) at async /builds/node_modules/serverless/scripts/serverless.js:601:7

Use the lts version of Node.js

For anyone else seeing this issue - I had the same problem. The issue was that node v23 has just been released and obviously causes problems with serverless.

I updated my bitbucket pipeline to use the node v22 image instead of node latest

I still see the error using the node:22-bullseye version (can’t use node22 for other reasons)

It’s an unrelated issue if you are reviving an 4 year old thread. I’m not sure why people are doing this.

We use node:18-bullseye-slim on GitLab, and locally on Ubuntu 24.04 LTS, with no issues.

Probably this issue: [v3] Node v22.12.0 Error _serverlessExternalPluginName · Issue #12936 · serverless/serverless · GitHub

Appears to be fixed in the latest version of serverless