# Updating dependency of an installed node

**URL:** https://discourse.nodered.org/t/updating-dependency-of-an-installed-node/40046
**Category:** General
**Created:** [30 January 2021 12:00 UTC](https://discourse.nodered.org/t/updating-dependency-of-an-installed-node/40046 "2021-01-30T12:00:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![AleksCee](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alekscee/32/36183_2.png) [@AleksCee](https://discourse.nodered.org/u/AleksCee)
#### Post date: [30 January 2021 12:00 UTC](https://discourse.nodered.org/t/updating-dependency-of-an-installed-node/40046/1 "2021-01-30T12:00:41Z")

</div>

Hello, is there a way to change only the dependency of one package without fork, reinstall, reconfigure the complete node?

Reason: ["failed to load routines: "no body"" · Issue #191 · 586837r/node-red-contrib-alexa-remote2 · GitHub](https://github.com/586837r/node-red-contrib-alexa-remote2/issues/191#issuecomment-770102999)

I have try to mag this change in the package.json in the installed package and run npm outdated on this packed but it not seams to work.

The way in the issue change the node name and so on, and I must reconfigure all my flows, not a easy way, I think.

Thanks, Alex

---

<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: [30 January 2021 12:17 UTC](https://discourse.nodered.org/t/updating-dependency-of-an-installed-node/40046/2 "2021-01-30T12:17:03Z")

</div>

Why don't you want to fork it? If you do that, edit package.json and then in your .node-red folder run  
`npm install yourgitid/node-red-contrib-alexa-remote2`  
and restart node red you are all done.

The alternative without forking is to clone the repository to the node red server machine, edit package.json and then, from .node-red folder  
`npm install path/to/clone/node-red-contrib-alexa-remote2`

The advantage of a fork is that it will stay there and you don't need to remember to do it again if you have to rebuild your system.

---

<div class="post-metadata">

### Author: ![AleksCee](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alekscee/32/36183_2.png) [@AleksCee](https://discourse.nodered.org/u/AleksCee)
#### Post date: [30 January 2021 14:30 UTC](https://discourse.nodered.org/t/updating-dependency-of-an-installed-node/40046/3 "2021-01-30T14:30:31Z")

</div>

Hi @Colin , thank you for the quick answer.

About the first solution: will the npm install of my fork overwrite the original installation and if so, what about updates? And how did I go back to the original version, if the owner make the required update of dependency for his project?

Sorry for this questions, I only use the Palette Manager right now. And my installation is in a docker if this info helpful.

Thanks, Alex

---

<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: [30 January 2021 15:39 UTC](https://discourse.nodered.org/t/updating-dependency-of-an-installed-node/40046/4 "2021-01-30T15:39:17Z")

</div>

I don't know much about docker, but the only difference should be, I think, that you will need to go to a terminal in the docker container to run npm.

> [@AleksCee](#):
>
> will the npm install of my fork overwrite the original installation

Yes

> [@AleksCee](#):
>
> what about updates

Updates to the original version won't do anything. If you update the fork then run the `npm install yourgitid/...` again.

To get back to the original version  
`npm remove node-red-contrib-alexa-remote2`  
`npm install node-red-contrib-alexa-remote2`

> [@AleksCee](#):
>
> Sorry for this questions

No problem, npm is not the most intuitive of tools.

---

<div class="post-metadata">

### Author: ![AleksCee](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alekscee/32/36183_2.png) [@AleksCee](https://discourse.nodered.org/u/AleksCee)
#### Post date: [30 January 2021 16:03 UTC](https://discourse.nodered.org/t/updating-dependency-of-an-installed-node/40046/5 "2021-01-30T16:03:11Z")

</div>

One last question:

> [@Colin](#):
>
> To get back to the original version  
> `npm remove node-red-contrib-alexa-remote2`  
> `npm install node-red-contrib-alexa-remote2`

If I do the remove command, will node-red delete the nodes and the config? Or should I do all the commands while node-red is stopped? But in Docker I can only stop node-red by stopping the container and then a can‘t attached to the shell in the container to run npm.  
Or is the remove/install not a problem with a running node-red instance?

Thanks, Alex

---

<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: [30 January 2021 16:15 UTC](https://discourse.nodered.org/t/updating-dependency-of-an-installed-node/40046/6 "2021-01-30T16:15:22Z")

</div>

> [@AleksCee](#):
>
> the remove/install not a problem with a running node-red instance?

It is not a problem to run npm while node-red is running. npm manipulates the files in your `.node-red/node_modules` folder, and `package.json` and `package-lock.json`. All of those are read when node-red is started and the nodes in node\_modules are loaded, but are not referenced again, unless you use the package manager, which runs npm behind the scenes. So provided you do not run the package manager at the same time as running npm in a terminal then you should not have a problem. I do it all the time.

**[Edit]** Also the fact that you have temporarily removed the node will not affect your flows, they are in your flows file which npm does not touch.

---

<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: [31 March 2021 16:15 UTC](https://discourse.nodered.org/t/updating-dependency-of-an-installed-node/40046/7 "2021-03-31T16:15:34Z")

</div>

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