Node-Red 1.3.1 and sqlite3 again

The only way I could get node-sqlite working after updating nodejs to v14 was by reverting back to v12, removing all sqlite nodes from my flows and deleting the node on the palette manager.

I then re-updated to nodejs 14, restarted Node-Red and re-installed sqlite (this took a while so I am guessing that it was rebuilding itself automagically). The nodes in the flows were replaced & configured and everything was rosy in the garden again.

This worked for both Pi Node-Red installations and the Ubuntu v16 installation. It did not work for my Ubuntu v24 Node-Red - no idea why but may have something to do with the fact that this installation did not use the standard script.

Of course I can Colin and I'm really grateful for your time - I LOVE NR but this updating issue has plaued me for years - I thought it had gone away until this week...

my package.json

{
  "name": "node-red-project",
  "description": "A Node-RED Project",
  "version": "0.0.1",
  "dependencies": {
    "@node-red-contrib-themes/midnight-red": "^1.4.5",
    "bcryptjs": "^2.4.3",
    "dateformat": "^3.0.3",
    "i2c-bus": "^4.0.7",
    "moment": "^2.24.0",
    "node-red-contrib-advanced-ping": "^1.2.0",
    "node-red-contrib-alexa-local": "^0.3.24",
    "node-red-contrib-alexa-notifyme": "~1.0.2",
    "node-red-contrib-alexa-remote2": "~3.10.4",
    "node-red-contrib-amazon-echo": "~0.1.10",
    "node-red-contrib-bigtimer": "~2.7.3",
    "node-red-contrib-blynk-ws": "~1.0.5",
    "node-red-contrib-boolean-logic": "0.0.3",
    "node-red-contrib-color-convert": "0.0.8",
    "node-red-contrib-config": "~1.2.1",
    "node-red-contrib-diode": "^1.0.1",
    "node-red-contrib-dsm": "~0.14.1",
    "node-red-contrib-esplogin": "^1.3.7",
    "node-red-contrib-ewelink": "~2.0.0",
    "node-red-contrib-file-function": "^1.1.2",
    "node-red-contrib-fs-ops": "~1.6.0",
    "node-red-contrib-ftp": "0.0.6",
    "node-red-contrib-grove": "^1.0.9",
    "node-red-contrib-heater-controller": "~2.0.2",
    "node-red-contrib-ibm-watson-iot": "^0.2.8",
    "node-red-contrib-influxdb": "~0.6.0",
    "node-red-contrib-isonline": "^1.1.15",
    "node-red-contrib-moment": "~4.0.0",
    "node-red-contrib-npm": "~1.0.2",
    "node-red-contrib-owntracks": "0.0.2",
    "node-red-contrib-particle": "~1.2.0",
    "node-red-contrib-play-audio": "^2.5.0",
    "node-red-contrib-ramp-thermostat": "~0.8.3",
    "node-red-contrib-tasmota": "~0.9.7",
    "node-red-contrib-telegrambot": "~9.2.1",
    "node-red-contrib-theme-midnight-red": "^1.0.0-beta.10",
    "node-red-contrib-timeout": "~1.1.4",
    "node-red-contrib-ui-led": "~0.4.9",
    "node-red-contrib-ui-level": "~0.1.40",
    "node-red-contrib-ui-time-scheduler": "~1.6.1",
    "node-red-contrib-virtual-smart-home": "~1.21.2",
    "node-red-contrib-web-worldmap": "~2.8.2",
    "node-red-dashboard": "~2.28.2",
    "node-red-node-arduino": "~0.3.1",
    "node-red-node-darksky": "~0.1.19",
    "node-red-node-email": "~1.8.3",
    "node-red-node-emoncms": "~0.3.0",
    "node-red-node-geofence": "~0.2.1",
    "node-red-node-google": "~0.2.2",
    "node-red-node-openweathermap": "~0.4.0",
    "node-red-node-pi-gpio": "^1.2.3",
    "node-red-node-ping": "^0.3.1",
    "node-red-node-random": "^0.4.0",
    "node-red-node-rbe": "~0.2.9",
    "node-red-node-sentiment": "~0.1.6",
    "node-red-node-serialport": "^0.13.0",
    "node-red-node-smooth": "^0.1.2",
    "node-red-node-sqlite": "~0.4.3",
    "node-red-node-tail": "~0.1.1",
    "node-red-node-twitter": "~1.2.0",
    "node-red-node-ui-lineargauge": "~0.3.6"
  }
}

There has to be a better way Buckskin - upgrading should be a simple button press operation, not hour after hour of work...

The issue here is that it won't build with v12

Not sure what you mean. It will not build when updating node.js to v14, it has to be installed with node.js already updated. The problem is - every other node does.

In defence of the node writer he does say;

**Note** : the install process requires a compile of native code. This can take 15-20 minutes on
devices like a Raspberry Pi - please be prepared to wait a long time. Also if node.js is upgraded at any
 point you will need to rebuild the native part manually, for example.

cd ~/.node-red
npm rebuild

I have to confess I did not try this the last time I updated node.js as I had already discovered that installing the node AFTER updating node.js worked.

Exactly - nodejs 10.24.1 - no problem - but at SOME point it will come back to bite me - it really would be good to find a solution that works time and time again. That 4-liner forked for months - but not now - I've tried everything exactly as suggested - without success... Made 2 SD backups and one SSD backup tonight so I can get ambitious next time somone is up to throwing out ideas... and none of that addressed the inability of I2c to work on the nodejs update either... ALL of that - everything I use, is working on 10.24.1

Note the ~ on the front of the version. That says that the version installed must be at least 0.4.3 but must be less that 0.5.0, so it won't let you install 0.6.0. It should, I believe, say
"node-red-node-sqlite": "^0.4.3",
Which means at least 0.4.3 but less that 1.0.0, so it would allow updates to the current (0.6.0). I am currently investigating gets set to ~. There may be an issue in node-red because I see that if I install via the palette manager it ends up as ~ but if I install via the command line it is ^. Also I find that if I edit the file and change it to ^ and restart node-red it still won't let me upgrade via the palette manager, which I don't understand at all, unless a bug has crept into node-red.
In the meantime the best solution is to remove it via the command line and install it again.
npm remove node-red-node-sqlite
npm install node-red-node-sqlite
which should get you 0.6.0

I also note you are using a beta version of the midnight red theme, so there could be an issue there.

I will start another thread discussing why the versioning issue happening in the first place.
See Npm, versioning and palette manager confusions

That is a completely different issue. It is necessary to run npm rebuild after up upgrading nodejs. This matters for any node that has to be built, so it is not right to say that it is only sqlite that is a problem. It is also true for the serialport node for example. The Pi/Debian script does the rebuild for you, so it is only necessary to do it manually if you upgrade nodejs manually.

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