In local working fine but when i deployed on digital ocean Kubernetes server then showing error. please help....
CodePudding user response:
Check your node version. It happening in new version of node.
CodePudding user response:
This is not a kubernetes specific issue. Kubernetes is a docker orchestrator. So you have to modify your dockerfile to use a working node base image.
Also I would recommend to you to not use odd major versions of node, as they are bleeding edge. Best practice is to use LTS-versions for production, to specifically avoid such issues, and those are node versions with even major-version (12, 14, 16...).
If you use node:latest in your dockerfile, than you are using node 17.5, according to dockerhub. And thats why you have issues.
Best practice for node docker images is to pinpoint exact versions down to patch-version. E.g. use 16.14.0-alpine3.15 instead of 16-alpine. Thus also avoiding caching an old node 16 base image in docker and then wondering why you building on a different machine breaks.