# Updating to a new version of NR does not work with command

**URL:** <https://discourse.nodered.org/t/updating-to-a-new-version-of-nr-does-not-work-with-command/85298>\
**Category:** General\
**Created:** [7 February 2024 17:50 UTC](https://discourse.nodered.org/t/updating-to-a-new-version-of-nr-does-not-work-with-command/85298 "2024-02-07T17:50:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [7 February 2024 17:50 UTC](https://discourse.nodered.org/t/updating-to-a-new-version-of-nr-does-not-work-with-command/85298/1 "2024-02-07T17:50:12Z")

</div>

I made this topic a while ago:  
[https://discourse.nodered.org/t/edit-displays-if-a-new-node-red-update-is-available-online-and-update-it-from-the-dashboard/30061](https://discourse.nodered.org/t/edit-displays-if-a-new-node-red-update-is-available-online-and-update-it-from-the-dashboard/30061)

to display if a new version of NR was online AND to update it on the RPI in one click in Dashboard v1.  
Today the update request by the EXEC node:

```auto
sudo npm install -g --unsafe-perm node-red

```

does not work and gives me an error:

```auto
Command failed: sudo npm install -g --unsafe-perm node-red
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /usr/lib/node_modules/node-red
npm ERR! dest /usr/lib/node_modules/.node-red-eOn6FCQ9
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rename '/usr/lib/node_modules/node-red' -> '/usr/lib/node_modules/.node-red-eOn6FCQ9'

```

I see that I need to rename a folder because it is not empty, but I'm not sure I understand what to do to make my update command work again?

---

<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:** [7 February 2024 17:55 UTC](https://discourse.nodered.org/t/updating-to-a-new-version-of-nr-does-not-work-with-command/85298/2 "2024-02-07T17:55:10Z")

</div>

> [@SuperNinja](#):
>
> `dest /usr/lib/node_modules/.node-red-eOn6FCQ9`

Delete this directory. That's it.

These can get left behind by a failed or interrupted npm install.

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [7 February 2024 18:23 UTC](https://discourse.nodered.org/t/updating-to-a-new-version-of-nr-does-not-work-with-command/85298/3 "2024-02-07T18:23:40Z")

</div>

🤩 thank you, I deleted this folder and the update worked

---

<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 February 2024 18:23 UTC](https://discourse.nodered.org/t/updating-to-a-new-version-of-nr-does-not-work-with-command/85298/4 "2024-02-21T18:23:40Z")

</div>

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