# Modules not compiling

**URL:** <https://discourse.nodered.org/t/modules-not-compiling/30572>\
**Category:** General\
**Created:** [23 July 2020 00:20 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572 "2020-07-23T00:20:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![chuckf201](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chuckf201/32/91382_2.png) [@chuckf201](https://discourse.nodered.org/u/chuckf201)\
**Post date:** [23 July 2020 00:20 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/1 "2020-07-23T00:20:57Z")

</div>

I've just updated node-red to V1.1.2 and NodeJS to V1.15.0. npm v is 6.14.7

```auto
22 Jul 20:12:42 - [error] [Bme280:7ae83153.39fe6] Error: The module '/home/pi/.node-red/node_modules/bme280-sensor/node_modules/i2c-bus/build/Release/i2c.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 67. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
22 Jul 20:12:42 - [info] [Bme280:BME280-2] Initializing on bus1 addr:118
22 Jul 20:12:42 - [error] [Bme280:86e60cd6.5a8c6] Error: The module '/home/pi/.node-red/node_modules/bme280-sensor/node_modules/i2c-bus/build/Release/i2c.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 67. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
22 Jul 20:12:45 - [info] [Bme280:6686642b.eadd2c] Initializing on bus1 addr:118
22 Jul 20:12:45 - [error] [Bme280:6686642b.eadd2c] Error: The module '/home/pi/.node-red/node_modules/bme280-sensor/node_modules/i2c-bus/build/Release/i2c.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 67. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

```

i2c node and BME280 still give me the "recompile" error.  
Following the direction does not solve the problem.  
Additionally, serialport gave me the same problem.  
Any help would be appreciated.

---

<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:** [23 July 2020 06:54 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/2 "2020-07-23T06:54:19Z")

</div>

> [@chuckf201](#):
>
> NodeJS to V1.15.0

I hope not, can you check that please. `node -v`.  
Then show us the output from `npm install` in the `.node-red` folder.

---

<div class="post-metadata">

**Author:** ![chuckf201](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chuckf201/32/91382_2.png) [@chuckf201](https://discourse.nodered.org/u/chuckf201)\
**Post date:** [23 July 2020 15:06 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/3 "2020-07-23T15:06:06Z")

</div>

node -v: 11.15.0  
npm -v : 6.14.7  
what is the name of the "npm install" output file. There is no \*.log file there after doing  
a 'find ./node-red -print|grep npm|grep log'

---

<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:** [23 July 2020 15:17 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/4 "2020-07-23T15:17:03Z")

</div>

> [@chuckf201](#):
>
> node -v: 11.15.0

That isn't a supported version, either go back to 10.x or on to 12.x or 14.x. Where did you get version 11.15.0? That dates from march 2019.  
There isn't a log, it appears in the terminal when you run the command. But first you need to install a valid version of nodejs.

**[Edit]** If you are using a Debian based OS such as Raspbian or Ubuntu, use the install/update script for the Pi/Ubuntu and should sort out nodejs too. [Running on Raspberry Pi : Node-RED](https://nodered.org/docs/getting-started/raspberrypi)

---

<div class="post-metadata">

**Author:** ![chuckf201](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chuckf201/32/91382_2.png) [@chuckf201](https://discourse.nodered.org/u/chuckf201)\
**Post date:** [23 July 2020 15:29 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/5 "2020-07-23T15:29:37Z")

</div>

Colin: Not sure where I pulled the script might be the nodejs site but not sure.  
I will run the script from the site you linked to:

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

```

Thanks for the catch.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 July 2020 15:36 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/6 "2020-07-23T15:36:59Z")

</div>

We would expect Node 11 to work. The first step shouldn't be to install a different version of Node.js.

If you update the version of Node.js (to any new major version), you have to recompile modules that have binary components.

This is what the error is telling you.

So you need to go to `~/.node-red` and run `npm rebuild` and see if that fixes things.

It doesn't always - sometimes you have to explicitly ask it to rebuild or reinstall the individual modules in question.

---

<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:** [23 July 2020 15:44 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/7 "2020-07-23T15:44:23Z")

</div>

> [@knolleary](#):
>
> run `npm rebuild`

Doesn't `npm install` do that as suggested in the error message?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 July 2020 15:48 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/8 "2020-07-23T15:48:43Z")

</div>

Yes, but I don't think we've confirmed exactly what commands @chuckf201 ran and where to try to resolve this.

---

<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:** [23 July 2020 15:51 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/9 "2020-07-23T15:51:14Z")

</div>

> [@knolleary](#):
>
> I don't think we've confirmed exactly what commands @chuckf201 ran

Well I previously suggested he ran `npm install` and post the log and he said he couldn't find the log, which implies the command was run.

---

<div class="post-metadata">

**Author:** ![chuckf201](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chuckf201/32/91382_2.png) [@chuckf201](https://discourse.nodered.org/u/chuckf201)\
**Post date:** [23 July 2020 16:22 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/10 "2020-07-23T16:22:40Z")

</div>

I ran the script as colin described and am still getting error for bme280-sensor and i2c modules. Here's the results:  
"Error: The module '/home/pi/.node-red/node\_modules/bme280-sensor/node\_modules/i2c-bus/build/Release/i2c.node'was compiled against a different Node.js version usingNODE\_MODULE\_VERSION 64. This version of Node.js requiresNODE\_MODULE\_VERSION 72. Please try re-compiling or re-installingthe module (for instance, using `npm rebuild` or `npm install`).  
"  
23 Jul 11:49:02 - [info] Node-RED version: v1.1.2  
23 Jul 11:49:02 - [info] Node.js version: v12.18.3  
23 Jul 11:49:02 - [info] Linux 5.4.51-v7+ arm LE

It seems the BME280 has not been updated and wont run on this release. Same with i2c.  
I'm looking for a replacement to read a bme280 (temp, humidity and Bar.Press).

---

<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:** [23 July 2020 17:43 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/11 "2020-07-23T17:43:02Z")

</div>

Show us the full output from `npm rebuild` run in the .node-red folder.

---

<div class="post-metadata">

**Author:** ![chuckf201](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chuckf201/32/91382_2.png) [@chuckf201](https://discourse.nodered.org/u/chuckf201)\
**Post date:** [23 July 2020 17:53 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/12 "2020-07-23T17:53:13Z")

</div>

I've installed node-red-contrib-bme280 version 1.0. Compiled and installed clean.  
All is good.  
I'm back in business.  
Colin and Knolleary: Thanks for your help. I really learned a lot about trubleshooting node-js.

---

<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:** [6 August 2020 17:53 UTC](https://discourse.nodered.org/t/modules-not-compiling/30572/13 "2020-08-06T17:53:16Z")

</div>

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