# Error when installing via script onto brand new Raspberry Pi Zero with Trixie

**URL:** <https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472>\
**Category:** General\
**Created:** [21 October 2025 17:10 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472 "2025-10-21T17:10:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![grant1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grant1/32/49890_2.png) [@grant1](https://discourse.nodered.org/u/grant1)\
**Post date:** [21 October 2025 17:10 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/1 "2025-10-21T17:10:40Z")

</div>

Trying to install using the script ([here](https://nodered.org/docs/getting-started/raspberrypi)) onto a brand new Raspberry Pi Zero running [Trixie](https://www.raspberrypi.com/news/trixie-the-new-version-of-raspberry-pi-os/) (nothing else installed yet), but apparently installing Node.js the problem.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5b59e6f5bf96c900b22cc1bb3c0632024281f2f0.png)

After getting the above error the first time, I did `sudo apt-get update` and then ran the script again, but get the same error.

---

<div class="post-metadata">

**Author:** ![grant1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grant1/32/49890_2.png) [@grant1](https://discourse.nodered.org/u/grant1)\
**Post date:** [21 October 2025 17:50 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/2 "2025-10-21T17:50:10Z")

</div>

Fixed by installing npm (`sudo apt install npm`), but is this something new with Trixie? I installed the "lite" OS version (sans desktop), so perhaps that version does not include npm.

---

<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 October 2025 18:46 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/3 "2025-10-21T18:46:06Z")

</div>

No. That isn't the solution. The nodejs install should include npm. @dceejay is the expert in this area.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 October 2025 18:47 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/4 "2025-10-21T18:47:47Z")

</div>

I installed Node-red on a Raspberry pi zero 2 with no problems.

1 Burn RPiOS lite Trixie 64 bit to sd card.  
2 sudo apt update && sudo apt full-upgrade.  
3 Run Node-red install script.  
4 sudo systemctl enable nodered  
5 reboot.

---

<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 October 2025 18:50 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/5 "2025-10-21T18:50:19Z")

</div>

I think the nodejs install on a Zero is different, so that may be a factor. I haven't got a spare non-zero or to try it on.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 October 2025 18:53 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/6 "2025-10-21T18:53:16Z")

</div>

It may well be different. I have retired all 32 bit, single core pies.

---

<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 October 2025 19:29 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/7 "2025-10-21T19:29:50Z")

</div>

@grant1 what do these commands show (just the first few lines of each, if they show loads of entries)  
`apt policy nodejs`  
also  
`apt policy npm`  
and  
`which nodejs`  
`which npm`

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 October 2025 21:07 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/8 "2025-10-21T21:07:17Z")

</div>

Somehow it has installed the default repo version of nodejs which doesn't include npm (as you found) rather than the Nodesource version - our script should remove/replace it if you specify --node20 (or --node22) - but I haven't checked out Trixie yet - will do so tomorrow.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 October 2025 12:38 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/9 "2025-10-22T12:38:22Z")

</div>

OK - just tried a clean install of Trixie minimal on a PiZeroW - and just ran the install script - all OK... so yes for some reason you had pre-installed nodejs and it didn't handle it well... I have also now tried to re-create that situation by apt installing nodejs and can confirm re-running the script with --node22 also cleans it up OK.

---

<div class="post-metadata">

**Author:** ![grant1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grant1/32/49890_2.png) [@grant1](https://discourse.nodered.org/u/grant1)\
**Post date:** [22 October 2025 13:01 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/10 "2025-10-22T13:01:03Z")

</div>

Thank you for the testing. I have another Pi Zero that I to set up soon with Trixie minimal then Node-RED, and will report back on what happens (hopefully nothing as you found).

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 October 2025 15:14 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/11 "2025-10-22T15:14:47Z")

</div>

just don't try and install nodejs first 🙂

---

<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:** [22 October 2025 20:28 UTC](https://discourse.nodered.org/t/error-when-installing-via-script-onto-brand-new-raspberry-pi-zero-with-trixie/99472/12 "2025-10-22T20:28:45Z")

</div>

If you do have a problem then post the log file, /var/log/nodered-install.log
