Sls deploy - serverless-offline - randomUUID issue

when i run " sls deploy " command, i am getting this error

/node_modules/serverless-offline/src/utils/createUniqueId.js:1
import { randomUUID } from ‘node:crypto’
^^^^^^^^^^
SyntaxError: The requested module ‘node:crypto’ does not provide an export named ‘randomUUID’
at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21)
at async ModuleJob.run (internal/modules/esm/module_job.js:143:5)
at async Loader.import (internal/modules/esm/loader.js:165:24)
at async module.exports (C:\Prabha\Dev\Office_Live\bookingapi\node_modules\serverless\lib\utils\import-module.js:9:15)
at async PluginManager.resolveServicePlugins (C:\Prabha\Dev\Office_Live\bookingapi\node_modules\serverless\lib\classes\plugin-manager.js:198:18)
at async PluginManager.loadAllPlugins (C:\Prabha\Dev\Office_Live\bookingapi\node_modules\serverless\lib\classes\plugin-manager.js:136:36)
at async Serverless.init (C:\Prabha\Dev\Office_Live\bookingapi\node_modules\serverless\lib\serverless.js:141:5)
at async C:\Prabha\Dev\Office_Live\bookingapi\node_modules\serverless\scripts\serverless.js:591:7

@prabakaranlookman I have the same issue. Did you find a solution for it?

1 Like

Hi, can you try updating your node version?
According to their github page, serverless-offlice v9.1.6 requires node >= 14.18.0

2 Likes