# Error to Install Node Home Assistant

**URL:** https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443
**Category:** General
**Created:** [8 July 2018 03:47 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443 "2018-07-08T03:47:38Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)
#### Post date: [8 July 2018 03:47 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443/1 "2018-07-08T03:47:39Z")

</div>

HI,

I'm trying to install node-red-contrib-home-assistant and it has the following error:

pi@raspberrypi:~ $ sudo npm install node-red-contrib-home-assistant  
npm ERR! code 128  
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b 0.18.2 git://github.com/node-red/node-red.git /root/.npm /\_cacache/tmp/git-clone-d1cbe3f3  
npm ERR! fatal: could not create leading directories of '/root/.npm/\_cacache/tmp/git-clone-d1cbe3f3': Permission den ied  
npm ERR!

npm ERR! A complete log of this run can be found in:  
npm ERR! /root/.npm/\_logs/2018-07-08T03\_44\_46\_545Z-debug.log

Anyone have any idea what might be happening?

---

<div class="post-metadata">

### Author: ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)
#### Post date: [8 July 2018 04:34 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443/2 "2018-07-08T04:34:39Z")

</div>

I not use [Hass.io](http://Hass.io).

My HA is running in raspbian.

---

<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: [8 July 2018 07:15 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443/3 "2018-07-08T07:15:13Z")

</div>

Please find the node on [flows.nodered.org](http://flows.nodered.org) and follow the instructions to install

---

<div class="post-metadata">

### Author: ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)
#### Post date: [8 July 2018 17:07 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443/4 "2018-07-08T17:07:16Z")

</div>

I followed the steps in the link but it did not work.  
Give the error I posted here.

---

<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: [8 July 2018 17:19 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443/5 "2018-07-08T17:19:19Z")

</div>

Really?  
Your original post shows you are logged in as the user pi.  
If you followed the command as per the readme, it shouldn't be trying to write to /root/.npm

Please post the commands and responses here

---

<div class="post-metadata">

### Author: ![dedynobre](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dedynobre/32/950_2.png) [@dedynobre](https://discourse.nodered.org/u/dedynobre)
#### Post date: [8 July 2018 17:24 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443/6 "2018-07-08T17:24:46Z")

</div>

I already tried to install directly by the node red and also by the terminal.  
But both are failing.

pi@raspberrypi:~ $ sudo npm install node-red-contrib-home-assistant  
npm ERR! code 128  
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b 0.18.2 git://github.com/node-red/node-red.git /root/.npm/\_cacache/tmp/git-clone-e7cad51d  
npm ERR! fatal: could not create leading directories of '/root/.npm/\_cacache/tmp/git-clone-e7cad51d': Permission denied  
npm ERR!

npm ERR! A complete log of this run can be found in:  
npm ERR! /root/.npm/\_logs/2018-07-08T17\_22\_54\_070Z-debug.log

---

<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: [8 July 2018 17:27 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443/7 "2018-07-08T17:27:56Z")

</div>

No that's the same command you ran first time, and isn't the list of commands as per the ReadMe.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [8 July 2018 20:48 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443/8 "2018-07-08T20:48:48Z")

</div>

it also doesn't look like you are in the .node-red directory when you issue the NPM command. When you loginto the pi you should issue a `cd .node-red` and then the npm command

---

<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: [9 July 2018 06:58 UTC](https://discourse.nodered.org/t/error-to-install-node-home-assistant/1443/9 "2018-07-09T06:58:09Z")

</div>

and the command to use (not the one listed above -twice) and to cd .node-red is listed in the ReadMe…
