# Is it safe to clear npm cache

**URL:** <https://discourse.nodered.org/t/is-it-safe-to-clear-npm-cache/85726>\
**Category:** General\
**Created:** [21 February 2024 10:49 UTC](https://discourse.nodered.org/t/is-it-safe-to-clear-npm-cache/85726 "2024-02-21T10:49:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![questuk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/questuk/32/4059_2.png) [@questuk](https://discourse.nodered.org/u/questuk)\
**Post date:** [21 February 2024 10:49 UTC](https://discourse.nodered.org/t/is-it-safe-to-clear-npm-cache/85726/1 "2024-02-21T10:49:01Z")

</div>

Hi I have 53mb of **cacache** , is it safe in Node-RED to remove these  
and what command to use, I am using Linux.

Thanks

![08](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/b/8b3f82e0e4ea93f036af98d33d76e318a0ce4980.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 February 2024 10:52 UTC](https://discourse.nodered.org/t/is-it-safe-to-clear-npm-cache/85726/2 "2024-02-21T10:52:44Z")

</div>

safe - yeah. Recommended - not really, but no harm either.

`sudo npm cache clean --force`

But 53MB is not really a lot TBH.

---

<div class="post-metadata">

**Author:** ![questuk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/questuk/32/4059_2.png) [@questuk](https://discourse.nodered.org/u/questuk)\
**Post date:** [21 February 2024 11:05 UTC](https://discourse.nodered.org/t/is-it-safe-to-clear-npm-cache/85726/3 "2024-02-21T11:05:40Z")

</div>

Thanks Steve,

I am backing up to Google drive and for the **npm** it will take hours, because of all the small files ?

Or can I **not** back these up and if I restore to Node-RED in the future, will it still work **correctly**?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 February 2024 11:13 UTC](https://discourse.nodered.org/t/is-it-safe-to-clear-npm-cache/85726/4 "2024-02-21T11:13:37Z")

</div>

No need to backup anything in .npm

---

<div class="post-metadata">

**Author:** ![questuk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/questuk/32/4059_2.png) [@questuk](https://discourse.nodered.org/u/questuk)\
**Post date:** [21 February 2024 12:30 UTC](https://discourse.nodered.org/t/is-it-safe-to-clear-npm-cache/85726/5 "2024-02-21T12:30:40Z")

</div>

Thanks Colin, I won't back it up 👍

This forum is great for helping people like me out 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 February 2024 15:45 UTC](https://discourse.nodered.org/t/is-it-safe-to-clear-npm-cache/85726/6 "2024-02-21T15:45:49Z")

</div>

In addition, in your .node-red folder where the flows file is (assuming you have a conventional install) then you don't need to backup the node\_modules folder which can be huge. If you have to restore then you cd into the .node-red folder and run `npm install` and it will restore it by installing any extra nodes you need.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 May 2024 15:46 UTC](https://discourse.nodered.org/t/is-it-safe-to-clear-npm-cache/85726/7 "2024-05-21T15:46:45Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
