# Lodash installation issue in Pagination section - please assist

**URL:** <https://forum.codewithmosh.com/t/lodash-installation-issue-in-pagination-section-please-assist/14872>\
**Category:** React\
**Created:** [September 1, 2022, 10:44pm UTC](https://forum.codewithmosh.com/t/lodash-installation-issue-in-pagination-section-please-assist/14872 "2022-09-01T22:44:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj91](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@Raj91](https://forum.codewithmosh.com/u/Raj91)\
**Post date:** [September 1, 2022, 10:44pm UTC](https://forum.codewithmosh.com/t/lodash-installation-issue-in-pagination-section-please-assist/14872/1 "2022-09-01T22:44:51Z")

</div>

Hello,  
Good Day,

I’m at the pagination section and struck at “lodash” part. I’ve attached both my pagination code, and vulnerabilities displayed when I installed the lodash@4.17.10.  
After repeating the same steps, still I see only 1-page number in my vidly project.  
I doubt some version or compatibility issues in lodash cause this issue.  
It`d be

 ![Pagination - 3](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/4/4b1f96578b43852e2eae0e50f5d894689784eea4.png)  
 ![Pagination - 2](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/d/d16356869a82948b2d1d7ff11f54cbbbae9907fb.png)  
 ![Pagination - 1](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/f/ff4fd883e4b0e8b8c13c37d18c81b2e9b827bfa1.png)  
more helpful if anyone could assist on this issue ASAP since I couldn’t move to the next session soon.

Thanks,  
Raj

---

<div class="post-metadata">

**Author:** ![jmrunkle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jmrunkle/32/3765_2.png) [@jmrunkle](https://forum.codewithmosh.com/u/jmrunkle)\
**Post date:** [September 2, 2022, 12:44am UTC](https://forum.codewithmosh.com/t/lodash-installation-issue-in-pagination-section-please-assist/14872/2 "2022-09-02T00:44:52Z")

</div>

That version of lodash is 4 years old. Unless there is some specific reason that version is needed, you should probably just install the latest version (which is still 2 years old - better, but not great; the package on GitHub has no commits since 2021). That is… if you actually _need_ lodash at all.

There are questions about if lodash is still necessary now that JavaScript actually supports many of the functions that lodash gave you - [Lodash in 2022: necessary or obsolete? – Nico Zerpa, Your JavaScript Friend](https://nicozerpa.com/lodash-underscore-necessary-or-obsolete/). I believe a rough equivalent for the `range` function you are using would be `[...Array(pagesCount).keys()]` (though you would have to change the usage of `page` to be `page+1` since the `range` call started at 1 instead of 0).

```auto
const pages = [...Array(pagesCount).keys()];

return <nav>
    <ul className="pagination">
      {pages.map(page => (
        <li className="page-item">
          <a className="page-link">{page+1}</a>
        </li>
      </ul>
    </nav>;

```

---

<div class="post-metadata">

**Author:** ![UniqueNospaceShort](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/uniquenospaceshort/32/1814_2.png) [@UniqueNospaceShort](https://forum.codewithmosh.com/u/UniqueNospaceShort)\
**Post date:** [September 3, 2022, 7:22am UTC](https://forum.codewithmosh.com/t/lodash-installation-issue-in-pagination-section-please-assist/14872/3 "2022-09-03T07:22:17Z")

</div>

Hi,  
I would have said he needs lodash in the context of the course but if JS covers many of those features that’s both a good news and good read.  
Thanks.

---

<div class="post-metadata">

**Author:** ![sobuzj](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sobuzj/32/4456_2.png) [@sobuzj](https://forum.codewithmosh.com/u/sobuzj)\
**Post date:** [September 3, 2022, 9:03am UTC](https://forum.codewithmosh.com/t/lodash-installation-issue-in-pagination-section-please-assist/14872/4 "2022-09-03T09:03:54Z")

</div>

```auto
still I see only 1-page number in my vidly project:: solution 

```

do a `console log` with `pagesCount` if return decimal number ex. 0.97, then convert it to number with `Math.ceil` and return with a condition ex.` if (pagesCount === 1) return null;`
