# It is not possible to update Palette Nodes (npm ERR! ENOTEMPTY: directory not empty)

**URL:** <https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427>\
**Category:** General\
**Created:** [11 February 2024 17:15 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427 "2024-02-11T17:15:52Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![annocun](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@annocun](https://discourse.nodered.org/u/annocun)\
**Post date:** [11 February 2024 17:15 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/1 "2024-02-11T17:15:52Z")

</div>

When I try to update or install any new node - always is the problem like below.

```auto
-----------------------------------------------------------
2024-02-11T17:13:11.117Z Install : node-red-contrib-calc 1.0.6

2024-02-11T17:13:12.068Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-calc@1.0.6
2024-02-11T17:13:15.708Z [err] npm
2024-02-11T17:13:15.710Z [err]  
2024-02-11T17:13:15.710Z [err] WARN config production Use `--omit=dev` instead.
2024-02-11T17:13:39.627Z [err] npm
2024-02-11T17:13:39.627Z [err]  
2024-02-11T17:13:39.628Z [err] ERR!
2024-02-11T17:13:39.628Z [err] code
2024-02-11T17:13:39.628Z [err] ENOTEMPTY
2024-02-11T17:13:39.630Z [err] npm
2024-02-11T17:13:39.631Z [err] ERR! syscall
2024-02-11T17:13:39.635Z [err] rename
2024-02-11T17:13:39.635Z [err] npm ERR! path /home/openhabian/.node-red/node_modules/agentkeepalive
2024-02-11T17:13:39.636Z [err] npm 
2024-02-11T17:13:39.636Z [err] ERR! dest /home/openhabian/.node-red/node_modules/.agentkeepalive-EDRIbhsj
2024-02-11T17:13:39.638Z [err] npm
2024-02-11T17:13:39.638Z [err] ERR! errno -39
2024-02-11T17:13:39.652Z [err] npm ERR! ENOTEMPTY: directory not empty, rename '/home/openhabian/.node-red/node_modules/agentkeepalive' -> '/home/openhabian/.node-red/node_modules/.agentkeepalive-EDRIbhsj'
2024-02-11T17:13:39.663Z [err] 
2024-02-11T17:13:39.664Z [err] npm
2024-02-11T17:13:39.665Z [err] ERR! A complete log of this run can be found in: /home/openhabian/.npm/_logs/2024-02-11T17_13_15_309Z-debug-0.log
2024-02-11T17:13:39.719Z rc=217

```

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [11 February 2024 17:20 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/2 "2024-02-11T17:20:41Z")

</div>

> [@annocun](#):
>
> `/home/openhabian/.node-red/node_modules/.agentkeepalive-EDRIbhsj`

Welcome to the forums @annocun

Delete the following folder: `/home/openhabian/.node-red/node_modules/.agentkeepalive-EDRIbhsj` (`.agentkeepalive-EDRIbhsj`)

and try again - Node JS has a stubborn behaviour when something it is trying todo gets stopped midway, and creates this situation.

---

<div class="post-metadata">

**Author:** ![annocun](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@annocun](https://discourse.nodered.org/u/annocun)\
**Post date:** [11 February 2024 17:27 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/3 "2024-02-11T17:27:40Z")

</div>

Welcome too. I deleted folder and try to update node and below result.

```auto
2024-02-11T17:24:54.223Z Install : node-red-contrib-calc 1.0.6

2024-02-11T17:24:55.203Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-calc@1.0.6
2024-02-11T17:24:57.834Z [err] npm
2024-02-11T17:24:57.838Z [err]  
2024-02-11T17:24:57.838Z [err] WARN config production Use `--omit=dev` instead.
2024-02-11T17:25:20.082Z [err] npm ERR! code ENOTEMPTY
2024-02-11T17:25:20.082Z [err] npm ERR! syscall rename
2024-02-11T17:25:20.082Z [err] npm ERR! path /home/openhabian/.node-red/node_modules/make-dir/node_modules/semver
2024-02-11T17:25:20.082Z [err] npm ERR! dest /home/openhabian/.node-red/node_modules/make-dir/node_modules/.semver-zdIZPmDn
2024-02-11T17:25:20.082Z [err] npm ERR! errno -39
2024-02-11T17:25:20.082Z [err] npm ERR! ENOTEMPTY: directory not empty, rename '/home/openhabian/.node-red/node_modules/make-dir/node_modules/semver' -> '/home/openhabian/.node-red/node_modules/make-dir/node_modules/.semver-zdIZPmDn'
2024-02-11T17:25:20.082Z [err] 
2024-02-11T17:25:20.082Z [err] npm ERR! A complete log of this run can be found in: /home/openhabian/.npm/_logs/2024-02-11T17_24_57_424Z-debug-0.log
2024-02-11T17:25:20.086Z rc=217

```

Should I delete

```auto
/home/openhabian/.node-red/node_modules/make-dir/node_modules/semver

```

---

<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:** [11 February 2024 17:30 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/4 "2024-02-11T17:30:43Z")

</div>

> [@annocun](#):
>
> ```auto
> /home/openhabian/.node-red/node_modules/make-dir/node_modules/.semver-zdIZPmDn'
> 
> ```

this one ☝

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [11 February 2024 17:30 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/5 "2024-02-11T17:30:47Z")

</div>

> [@annocun](#):
>
> `.semver-zdIZPmDn`

This one.... (not `semver`)  
And any other that looks like the same random collection of characters after the name before trying again.

If you don't, it will get stopped and create the same situation .

EDIT  
Snap @Steve-Mcl

---

<div class="post-metadata">

**Author:** ![annocun](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@annocun](https://discourse.nodered.org/u/annocun)\
**Post date:** [11 February 2024 17:48 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/6 "2024-02-11T17:48:39Z")

</div>

I deleted that file and now like below:

```auto
-----------------------------------------------------------
2024-02-11T17:45:19.713Z Install : node-red-contrib-calc 1.0.6

2024-02-11T17:45:20.716Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-calc@1.0.6
2024-02-11T17:45:23.552Z [err] npm
2024-02-11T17:45:23.556Z [err] WARN 
2024-02-11T17:45:23.557Z [err] config production Use `--omit=dev` instead.
2024-02-11T17:45:46.031Z [err] npm
2024-02-11T17:45:46.032Z [err]  
2024-02-11T17:45:46.033Z [err] ERR!
2024-02-11T17:45:46.033Z [err]  
2024-02-11T17:45:46.034Z [err] code ENOTEMPTY
2024-02-11T17:45:46.035Z [err] npm
2024-02-11T17:45:46.035Z [err] ERR!
2024-02-11T17:45:46.036Z [err] syscall
2024-02-11T17:45:46.036Z [err] rename
2024-02-11T17:45:46.036Z [err] npm
2024-02-11T17:45:46.038Z [err]  
2024-02-11T17:45:46.038Z [err] ERR! path
2024-02-11T17:45:46.039Z [err] /home/openhabian/.node-red/node_modules/node-red-node-sqlite
2024-02-11T17:45:46.041Z [err] npm 
2024-02-11T17:45:46.041Z [err] ERR! dest /home/openhabian/.node-red/node_modules/.node-red-node-sqlite-w19L5sVY
2024-02-11T17:45:46.043Z [err] npm 
2024-02-11T17:45:46.043Z [err] ERR! errno -39
2024-02-11T17:45:46.055Z [err] npm 
2024-02-11T17:45:46.055Z [err] ERR! ENOTEMPTY: directory not empty, rename '/home/openhabian/.node-red/node_modules/node-red-node-sqlite' -> '/home/openhabian/.node-red/node_modules/.node-red-node-sqlite-w19L5sVY'
2024-02-11T17:45:46.069Z [err] 
2024-02-11T17:45:46.070Z [err] npm
2024-02-11T17:45:46.070Z [err] ERR! A complete log of this run can be found in: /home/openhabian/.npm/_logs/2024-02-11T17_45_23_133Z-debug-0.log
2024-02-11T17:45:46.119Z rc=217

```

Should I repeat delete with all files and random letters of each time?

---

<div class="post-metadata">

**Author:** ![annocun](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@annocun](https://discourse.nodered.org/u/annocun)\
**Post date:** [11 February 2024 17:56 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/7 "2024-02-11T17:56:49Z")

</div>

I repeat it many times with different files and now

```auto
-----------------------------------------------------------
2024-02-11T17:52:54.262Z Install : node-red-contrib-calc 1.0.6

2024-02-11T17:52:55.272Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-calc@1.0.6
2024-02-11T17:52:57.940Z [err] npm
2024-02-11T17:52:57.944Z [err]  
2024-02-11T17:52:57.945Z [err] WARN config production Use `--omit=dev` instead.
2024-02-11T17:53:20.734Z [err] npm ERR! code ENOTEMPTY
2024-02-11T17:53:20.734Z [err] npm ERR! syscall rename
2024-02-11T17:53:20.734Z [err] npm ERR! path /home/openhabian/.node-red/node_modules/@mapbox/node-pre-gyp
2024-02-11T17:53:20.734Z [err] npm ERR! dest /home/openhabian/.node-red/node_modules/@mapbox/.node-pre-gyp-YqumRtlB
2024-02-11T17:53:20.734Z [err] npm ERR! errno -39
2024-02-11T17:53:20.734Z [err] npm ERR! ENOTEMPTY: directory not empty, rename '/home/openhabian/.node-red/node_modules/@mapbox/node-pre-gyp' -> '/home/openhabian/.node-red/node_modules/@mapbox/.node-pre-gyp-YqumRtlB'
2024-02-11T17:53:20.734Z [err] 
2024-02-11T17:53:20.734Z [err] npm ERR! A complete log of this run can be found in: /home/openhabian/.npm/_logs/2024-02-11T17_52_57_551Z-debug-0.log
2024-02-11T17:53:20.737Z rc=217

-----------------------------------------------------------
2024-02-11T17:54:35.716Z Install : node-red-contrib-calc 1.0.6

2024-02-11T17:54:36.721Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-calc@1.0.6
2024-02-11T17:54:39.158Z [err] npm WARN config production Use `--omit=dev` instead.
2024-02-11T17:55:08.416Z [err] npm WARN deprecated node-pre-gyp@0.12.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
2024-02-11T17:55:08.969Z [err] npm
2024-02-11T17:55:08.982Z [err]  
2024-02-11T17:55:08.982Z [err] ERR!
2024-02-11T17:55:08.983Z [err]  
2024-02-11T17:55:08.984Z [err] code ERR_INVALID_ARG_TYPE
2024-02-11T17:55:09.047Z [err] npm
2024-02-11T17:55:09.048Z [err]  
2024-02-11T17:55:09.055Z [err] ERR! The "from" argument must be of type string. Received undefined
2024-02-11T17:55:09.066Z [err] 
2024-02-11T17:55:09.068Z [err] npm ERR! A complete log of this run can be found in: /home/openhabian/.npm/_logs/2024-02-11T17_54_38_728Z-debug-0.log
2024-02-11T17:55:09.142Z rc=1

```

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [11 February 2024 18:03 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/8 "2024-02-11T18:03:52Z")

</div>

Many (if not all) do not use `openhab` here - so we cant know for sure if this has something todo with it.

But one thing to try...

And note: this is just advice - its upto you to try it (back up if you really need to)

1. Stop Node RED
2. Delete the folder `/home/openhabian/.node-red/` **node\_modules** (this will remove all folders)  
(NOT the **.node-red** folder)
3. within the folder : `/home/openhabian/.node-red`  
issue `npm install`
4. Restart Node RED

This will wipe and re-install all nodes to latest version.

---

<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:** [11 February 2024 18:27 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/9 "2024-02-11T18:27:39Z")

</div>

Question: Do you ever interrupt NPM in the middle of installing? (e.g. pressing `ctrl+c` or stopping node-red as installations are occuring?) - this can cause the artifacts you see.

Try this command (from your `.node-red` folder)

```auto
cd /home/openhabian/.node-red
npm cache clean –force

```

---

<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:** [11 February 2024 20:02 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/10 "2024-02-11T20:02:46Z")

</div>

I have an error _Argument starts with non-ascii dash_ with:

> [@Steve-Mcl](#):
>
> `npm cache clean –force`

Change with that :

```auto
npm cache clean --force

```

, is better. 😉

---

<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:** [11 February 2024 21:30 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/11 "2024-02-11T21:30:08Z")

</div>

There seems to be another sudden spurt in the prevalence of this problem. Is something going on I wonder.  
I can't understand why npm still doesn't survive the presence of these old temporary files. It has been an intermittent problem for years I think.

---

<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:** [11 February 2024 22:11 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/12 "2024-02-11T22:11:31Z")

</div>

Definitely a spike recently. Open to ideas.

Maybe we need to consider intercepting and interpreting the occurrence in node-red and offer to run the clean cache command?

---

<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:** [11 May 2024 22:12 UTC](https://discourse.nodered.org/t/it-is-not-possible-to-update-palette-nodes-npm-err-enotempty-directory-not-empty/85427/13 "2024-05-11T22:12:17Z")

</div>

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