# Use npm to update a node

**URL:** <https://discourse.nodered.org/t/use-npm-to-update-a-node/79068>\
**Category:** General\
**Created:** [8 June 2023 19:02 UTC](https://discourse.nodered.org/t/use-npm-to-update-a-node/79068 "2023-06-08T19:02:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [8 June 2023 19:02 UTC](https://discourse.nodered.org/t/use-npm-to-update-a-node/79068/1 "2023-06-08T19:02:03Z")

</div>

Node-RED is installed on Pi with the standard script :  
bash \<(curl -sL [https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered))

Is it possible to update a node such as Dashboard with npm at ".node-red" directory?

The node was installed from the admin panel, but user may not access the admin panel unless modifying "settings.js" file.

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [8 June 2023 19:39 UTC](https://discourse.nodered.org/t/use-npm-to-update-a-node/79068/2 "2023-06-08T19:39:14Z")

</div>

Yes, just run `npm update <pkg>` in `.node-red` directory.

---

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [8 June 2023 19:50 UTC](https://discourse.nodered.org/t/use-npm-to-update-a-node/79068/3 "2023-06-08T19:50:52Z")

</div>

Tested but it did not work? Used the following command:  
npm update node-red-dashboard

Dashboard was version 3.4. Restarted Node-RED after the command, but the admin panel still shows the old version 3.4. The latest version is 3.5.

---

<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:** [8 June 2023 19:54 UTC](https://discourse.nodered.org/t/use-npm-to-update-a-node/79068/4 "2023-06-08T19:54:57Z")

</div>

```auto
npm install node-red-dashboard@latest

```

---

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [8 June 2023 19:56 UTC](https://discourse.nodered.org/t/use-npm-to-update-a-node/79068/5 "2023-06-08T19:56:50Z")

</div>

Worked like a charm!

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [8 June 2023 19:57 UTC](https://discourse.nodered.org/t/use-npm-to-update-a-node/79068/6 "2023-06-08T19:57:38Z")

</div>

It depends on the semantic versioning defined in the `package.json`, to make it simple the following command will update your package to the latest version `npm install <pkg>@latest`. See [here](https://docs.npmjs.com/about-semantic-versioning#using-semantic-versioning-to-specify-update-types-your-package-can-accept)

---

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [8 June 2023 21:37 UTC](https://discourse.nodered.org/t/use-npm-to-update-a-node/79068/7 "2023-06-08T21:37:21Z")

</div>

Yes npm install works perfectly. To be safe, use the following command to update the node to a specific version (in case that future updates break anything). For example:

npm install node-red-dashboard@3.5.0

---

<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:** [22 June 2023 21:37 UTC](https://discourse.nodered.org/t/use-npm-to-update-a-node/79068/8 "2023-06-22T21:37:29Z")

</div>

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