# INA219 install woes

**URL:** https://discourse.nodered.org/t/ina219-install-woes/21267
**Category:** General
**Created:** [4 February 2020 15:22 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267 "2020-02-04T15:22:06Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![muggins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muggins/32/63013_2.png) [@muggins](https://discourse.nodered.org/u/muggins)
#### Post date: [4 February 2020 15:22 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/1 "2020-02-04T15:22:06Z")

</div>

I have a fresh install of Buster + node red (RPI 3b+) and am building up my system again from scratch.  
All my modules install fine except for ...npm install ina219  
It fails every time with error messages too numerous to add here.  
Any one else encountered this.  
thanks

---

<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: [4 February 2020 15:52 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/2 "2020-02-04T15:52:47Z")

</div>

Have you installed build-essential?  
On Ubuntu (which is usually near enough Buster) there are loads of warnings but it does install eventually. Look for something like

```auto
+ ina219@0.6.2
added 4 packages from 10 contributors in 8.921s

```

right at the end.

---

<div class="post-metadata">

### Author: ![muggins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muggins/32/63013_2.png) [@muggins](https://discourse.nodered.org/u/muggins)
#### Post date: [4 February 2020 16:11 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/3 "2020-02-04T16:11:25Z")

</div>

> [@muggins](#):
>
> npm install ina219

Nope! the last few lines are:

make: \*\*\* [i2c.target.mk:109: Release/obj.target/i2c/src/i2c.o] Error 1  
make: Leaving directory '/home/pi/.node-red/node\_modules/ina219/node\_modules/i2c-bus/build'  
gyp ERR! build error  
gyp ERR! stack Error: `make` failed with exit code: 2  
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node\_modules/npm/node\_modules/node-gyp/lib/build.js:194:23)  
gyp ERR! stack at ChildProcess.emit (events.js:223:5)  
gyp ERR! stack at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:272:12)  
gyp ERR! System Linux 4.19.93-v7+  
gyp ERR! command "/usr/bin/node" "/usr/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js" "rebuild"  
gyp ERR! cwd /home/pi/.node-red/node\_modules/ina219/node\_modules/i2c-bus  
gyp ERR! node -v v12.14.1  
gyp ERR! node-gyp -v v5.0.7  
gyp ERR! not ok  
npm WARN node-red-project@0.0.1 No repository field.  
npm WARN node-red-project@0.0.1 No license field.

npm ERR! code ELIFECYCLE  
npm ERR! errno 1  
npm ERR! i2c-bus@1.2.5 install: `node-gyp rebuild`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the i2c-bus@1.2.5 install script.  
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:  
npm ERR! /home/pi/.npm/\_logs/2020-02-04T16\_09\_22\_390Z-debug.log  
pi@atticPI:~/.node-red $

---

<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: [4 February 2020 16:53 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/4 "2020-02-04T16:53:23Z")

</div>

See [https://github.com/brettmarl/node-ina219/issues/6](https://github.com/brettmarl/node-ina219/issues/6)  
It seems the node will not install with nodejs 12. You could downgrade to nodejs 10 and hope the node is updated before you find a reason that you must use 12.

---

<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: [4 February 2020 16:57 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/5 "2020-02-04T16:57:35Z")

</div>

Did you try node-red-contrib-easybotics-ina219-sensor ?

---

<div class="post-metadata">

### Author: ![muggins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muggins/32/63013_2.png) [@muggins](https://discourse.nodered.org/u/muggins)
#### Post date: [4 February 2020 19:06 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/6 "2020-02-04T19:06:40Z")

</div>

Thanks.  
node-red-contrib-easybotics-ina219-sensor would not install either.  
How do I downgrade to nodejs 10?

---

<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: [4 February 2020 20:56 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/7 "2020-02-04T20:56:32Z")

</div>

First stop node-red and uninstall nodejs using  
`sudo apt remove nodejs`  
Then install version 10 using the instructions [in this post](https://nodesource.com/blog/installing-node-js-tutorial-ubuntu/), replacing the 6 in the command with 10, Then you have to re-install node-red (in order to rebuild bits of it for nodejs 10) using  
`sudo npm install -g node-red --unsafe-perm`  
Finally you have to rebuild all your locally installed nodes using

```auto
cd .node-red
npm rebuild

```

Then you should be able to restart node-red

---

<div class="post-metadata">

### Author: ![muggins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muggins/32/63013_2.png) [@muggins](https://discourse.nodered.org/u/muggins)
#### Post date: [4 February 2020 21:37 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/8 "2020-02-04T21:37:29Z")

</div>

Thanks so much.. I'll try that.

---

<div class="post-metadata">

### Author: ![muggins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muggins/32/63013_2.png) [@muggins](https://discourse.nodered.org/u/muggins)
#### Post date: [5 February 2020 08:37 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/9 "2020-02-05T08:37:20Z")

</div>

That all worked for me.. fantastic. It's a pleasure to come on to a forum where folks are so helpful and tolerant of those not so experienced. (unlike some other forums)  
thanks again.

---

<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: [5 February 2020 08:50 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/10 "2020-02-05T08:50:54Z")

</div>

Should you want to upgrade node red when a new release comes out you can still use the script to upgrade it. Since you have an acceptable version of nodejs already installed it will not upgrade it to 12.

---

<div class="post-metadata">

### Author: ![muggins](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muggins/32/63013_2.png) [@muggins](https://discourse.nodered.org/u/muggins)
#### Post date: [5 February 2020 09:06 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/11 "2020-02-05T09:06:16Z")

</div>

Sorry.. a little confused. You say I can upgrade, but then you say it will not upgrade.

---

<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: [5 February 2020 09:32 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/12 "2020-02-05T09:32:41Z")

</div>

the script will update node-red but leave node.js alone if it is a node.js v 10.X

---

<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: [5 April 2020 09:32 UTC](https://discourse.nodered.org/t/ina219-install-woes/21267/13 "2020-04-05T09:32:55Z")

</div>

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