# Updating things and what I'm seeing

**URL:** <https://discourse.nodered.org/t/updating-things-and-what-im-seeing/91926>\
**Category:** General\
**Created:** [29 September 2024 01:08 UTC](https://discourse.nodered.org/t/updating-things-and-what-im-seeing/91926 "2024-09-29T01:08:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [29 September 2024 01:08 UTC](https://discourse.nodered.org/t/updating-things-and-what-im-seeing/91926/1 "2024-09-29T01:08:18Z")

</div>

From my other thread: [Stuck with how to resolve this problem (Global context testing) - #22 by Trying\_to\_learn](https://discourse.nodered.org/t/stuck-with-how-to-resolve-this-problem-global-context-testing/91323/22)

@TotallyInformation

```auto
sudo apt update && sudo apt upgrade
sudo npm -g update
cd ~/.node-red
npm update

```

You can see here I have done the first line and am doing the second one.

```auto
pi@TimePi:~ $ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libdav1d3
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@TimePi:~ $ sudo npm -g update
npm ERR! code EEXIST
npm ERR! path /usr/bin/corepack
npm ERR! Refusing to delete /usr/bin/corepack: ../lib/node_modules/corepack/dist/corepack.js symlink target is not controlled by npm /usr/lib/node_modules/corepack
npm ERR! File exists: /usr/bin/corepack
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2024-09-29T01_01_42_577Z-debug.log
pi@TimePi:~ $ 

```

Is it I am doing things in the wrong order?  
I have (as yet) NOT updated anything else.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 September 2024 01:16 UTC](https://discourse.nodered.org/t/updating-things-and-what-im-seeing/91926/2 "2024-09-29T01:16:24Z")

</div>

> [@Trying\_to\_learn](#):
>
> `Refusing to delete`

You might want to check what has installed corepack. `sudo npm -g ls corepack` should do that. Does it really need to be a global install?

It seems that `/usr/bin/corepack` may have some odd permissions on it. Try removing it by hand before re-running the update.

> [@Trying\_to\_learn](#):
>
> Is it I am doing things in the wrong order?

Nope.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [29 September 2024 01:19 UTC](https://discourse.nodered.org/t/updating-things-and-what-im-seeing/91926/3 "2024-09-29T01:19:35Z")

</div>

(Thanks)

```auto
pi@TimePi:~ $ sudo npm -g ls corepack
/usr/lib
└── corepack@0.15.1 

   ╭────────────────────────────────────────────────────────────────╮
   │ │
   │ New major version of npm available! 6.14.18 → 10.8.3 │
   │ Changelog: https://github.com/npm/cli/releases/tag/v10.8.3 │
   │ Run npm install -g npm to update! │
   │ │
   ╰────────────────────────────────────────────────────────────────╯

pi@TimePi:~ $

```

So I'll do as suggested?  
`npm install -g npm`

Ok, I had to `sudo` it and it worked.

```auto
pi@TimePi:~ $ sudo npm install -g npm
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
npm WARN notsup Unsupported engine for npm@10.8.3: wanted: {"node":"^18.17.0 || >=20.5.0"} (current: {"node":"14.21.3","npm":"6.14.18"})
npm WARN notsup Not compatible with your version of node/npm: npm@10.8.3

+ npm@10.8.3
added 88 packages from 24 contributors, removed 345 packages and updated 113 packages in 46.071s
pi@TimePi:~ $ 

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [29 September 2024 01:29 UTC](https://discourse.nodered.org/t/updating-things-and-what-im-seeing/91926/4 "2024-09-29T01:29:55Z")

</div>

Hmmm..

```auto
pi@TimePi:~/.node-red $ npm update
ERROR: npm v10.8.3 is known not to run on Node.js v14.21.3. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.

ERROR:
/usr/lib/node_modules/npm/lib/utils/error-message.js:11
  er.message &&= replaceInfo(er.message)
             ^^^

SyntaxError: Unexpected token '&&='
    at wrapSafe (internal/modules/cjs/loader.js:1029:16)
    at Module._compile (internal/modules/cjs/loader.js:1078:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (/usr/lib/node_modules/npm/lib/cli/exit-handler.js:2:48)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
pi@TimePi:~/.node-red $ 

```

---

<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:** [29 September 2024 08:44 UTC](https://discourse.nodered.org/t/updating-things-and-what-im-seeing/91926/5 "2024-09-29T08:44:10Z")

</div>

Why are you trying to upgrade npm? npm comes with nodejs, there should be no need to upgrade it manually.

---

<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:** [29 September 2024 09:07 UTC](https://discourse.nodered.org/t/updating-things-and-what-im-seeing/91926/6 "2024-09-29T09:07:31Z")

</div>

Ah, I see, @TotallyInformation suggested that route. I think he was assuming that you did not use the usual [install/upgrade script](https://nodered.org/docs/getting-started/raspberrypi) to install node red and nodejs. The update is failing because you have not updated nodejs first.

As I said in your original thread, just use the usual [install/upgrade script](https://nodered.org/docs/getting-started/raspberrypi) to update node red and nodejs. Add --node20 on the end if you want to go to v20, which is probably a good idea. That will do everything 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:** [28 December 2024 09:07 UTC](https://discourse.nodered.org/t/updating-things-and-what-im-seeing/91926/7 "2024-12-28T09:07:36Z")

</div>

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