Study/Node.js

[Node.JS] If the above error is not helpful, you may want to try EJS-Lint 오류

토기발 2022. 12. 16. 23:05

노드js홈페이지에 카운터를 달기 위해 ejs에

    <div class="counter">
      <% if(counter){ %>
        Total <%= counter.totalCount %> visitors<br>
        (today: <%= counter.todayCount %>)
      <% } %>
    </div>

이렇게 코드를 입력했는데 If the above error is not helpful, you may want to try EJS-Lint 에러가 발생했다.

 

찾아보니 ejs가 업그레이드 되면서 include하는 방식이 제거되어 에러가 발생했다고 한다.

그래서 counter.totalCount counter('totalCount')로 수정했더니 해결되었다!

 

 

문제 해결에 참고한 블로그... 감사합니다.

https://prometheo.tistory.com/37