Modules not compiling

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

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.

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

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'

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

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:

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

Thanks for the catch.

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.

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

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

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.

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).

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

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.

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