Aws-sdk package broken

this is the error i get when importing the AWS module -

"
Cannot find module ‘util’ in ‘aws-sdk/lib’
Did you mean ‘./util’?
Requests that should resolve in the current directory need to start with ‘./’.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called ‘preferRelative’ which tries to resolve these kind of requests in the current directory too.
"

looks like there’s an issue with the npm install

Hi Nir,
Looking at the package’s API , there’s indeed no module called aws-sdk/util documented. It’s always aws-sdk/util-* something* .

Can you share more info, including your URL, code for importing the package, etc., so we can see if it’s a problem with your code? If the package is broken, you will need to contact Amazon. Thanks.

May I ask how you are importing the package on your backend file?

The error you describe is only printed when you try to import the package on the frontend. The npm package is meant only for server-side use, not frontend.

Good to know. I’ve moved it to the backend and it works now.

Thanks