# Unable to update nodes

**URL:** <https://discourse.nodered.org/t/unable-to-update-nodes/10394>\
**Category:** General\
**Created:** [21 April 2019 08:50 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394 "2019-04-21T08:50:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [21 April 2019 08:50 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/1 "2019-04-21T08:50:53Z")

</div>

I have updated Node-RED on one of my Pi's, and that worked nicely. But updating the nodes did not go that well. I first tried with Palette manager and got "Failed to update: node-red-contrib-fs-ops, Install failed, Check the log for more information"

I cheched the log, and it seemed like a permission problem:

`ERR! Error: EACCES: permission denied, access '/home/pi/.node-red/node_modules/node-red-contrib-fs-ops'`

Next step was manual installation, first by finding out which nodes that I needed to update:

```auto
cd ~/.node-red
npm outdated

```

So I tried using command line with sudo, but that gave me this:

```auto
pi@Z-Wave-Tellstick:~/.node-red $ sudo npm install node-red-contrib-fs-ops
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ node-red-contrib-fs-ops@1.5.0
updated 1 package and audited 1662 packages in 16.863s
found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for detail

```

And even if it says that "updated 1 package, the node is still on the old version. An idea what's happening here? There were in total six packages I tried to update, and none of them did  
Another one of my Pi's, which has the exact same "roots", built in December some time, updated without problems. I installed one Pi first with all the common stuff they all need installed and then split them into different uses and install the extra packages needed.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [21 April 2019 09:01 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/2 "2019-04-21T09:01:07Z")

</div>

The error message is because you probably chose to install it using `sudo` in the past

`cd` into the /home/pi/.node-red/node\_modules/ directory  
`ls -l` and see who owns the directories...

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [21 April 2019 09:03 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/3 "2019-04-21T09:03:01Z")

</div>

Thanks! But as I said I installed on the common "mother" and then only added the nodes I needed. Shouldn't that be the same on all, then? Also shouldn't it still work using

```auto
sudo npm install

```

Edit: And yes, root owns them. But am I not installing as root? If not, what should I do?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [21 April 2019 09:13 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/4 "2019-04-21T09:13:45Z")

</div>

You've logged in as pi. No you shouldn't be installing as root, you should never use the command sudo unless it is specified. It causes problems later such as this.

The command you should have used to install the node is listed in the nodes ReadMe.

You should no fix your permission/ownership problems and try again.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [21 April 2019 09:18 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/5 "2019-04-21T09:18:06Z")

</div>

I checked the other one that worked to upgrade, and pi was the owner there, so you're of course right. What I can't fathom is how root somehow has taken ownership over the folder, because as I said, I installed Node-RED only once and then split into the different Pi's. Also I have my install info here, and this is the command I used to install:

```auto
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

```

So now on to Google to find out how to change permissions... 😉

Edit: `sudo chown pi:pi -R /home/pi/.node-red/node_modules` and it works. Thanks again! 🙂

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [21 April 2019 09:40 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/6 "2019-04-21T09:40:32Z")

</div>

Btw this comes on all the updates, is it something I should worry about?

```auto
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.5/bcrypt_lib-v3.0.5-node-v57-linux-arm-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.5 and node@8.16.0 (node-v57 ABI, glibc) (falling back to source compile with node-gyp)

```

---

<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 April 2019 09:43 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/7 "2019-04-21T09:43:03Z")

</div>

in general no as it's an optional-dependency - but we can't see how that finished so can't comment if it was good or bad. If on a Pi it should complete successfully.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [21 April 2019 09:55 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/8 "2019-04-21T09:55:36Z")

</div>

Well, Node-RED seems to work normally, so I guess it finished successfully, then. 🙂

---

<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 April 2019 10:00 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/9 "2019-04-21T10:00:03Z")

</div>

well as I said it's optional so should work either way... but it handles encryption/decryption much faster if it is there and working.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [21 April 2019 10:01 UTC](https://discourse.nodered.org/t/unable-to-update-nodes/10394/10 "2019-04-21T10:01:33Z")

</div>

I don't think I use encryption for anything. Or is that an integral part of Node-RED?
