In my case I am using cdk deploy(aws lambda function)
cdk deploy
I removed the package-lock.json and ran the cdk deploy without doing npm i again (similar answer mentioned above)
package-lock.json
npm i