In this case, there are two options from what I’ve research so far.
- Including flag
--use-container, this flag will download an image from ECR public registry, then build your application inside docker without having to configure your local node version on your machine. This image is own by Amazon Linux and same version inside lambda itself.
- An out-dated SAM version might not include the current node version which is why you are getting an error, so to fix this, try to reinstall a current SAM version.
brew install aws-sam-cli
then verify your sam version afterwards if it’s current up to date.
download program here, then install on your laptop.
3. Then install node version 14
nvm install node 14