노드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')로 수정했더니 해결되었다!
문제 해결에 참고한 블로그... 감사합니다.
'Study > Node.js' 카테고리의 다른 글
Node.JS에러 - 로그아웃 오류(Error: req#logout requires a callback function) (0) | 2022.11.21 |
---|---|
Node.js 에러- Mongo Server Error: user is not allowed to do action [find] on [test.posts] (0) | 2022.10.22 |
Node.js에러 - node:internal/modules/cjs/loader:936 throw err; (0) | 2022.10.22 |
Node.js 미들웨어 사용하기(bodyParser, compression) (0) | 2022.09.07 |
Node.js 시멘틱 URL (0) | 2022.09.06 |