ES모듈에서 절대경로로 접근을 해야되서 __dirname을 출력해봤는데 아래와 같은 에러가 났다.
__dirname is not defined in ES module scope
위와 같이 선언하면 __dirname을 ES 모듈에서 사용할 수 있다.