MySql nodes compatible with node.js 20?

Hi All,

I'd like to run select/insert/update MySQL queries via Node-RED.
I'm using Node-RED 4.0.5 alsong with the recommended node.js version 20.

I tried installing those packages:
node-red-mysql-r2
node-red-node-mysql

But both packages fail installing with the same error message:
[err] npm error code EBADENGINE
[err] npm error engine Unsupported engine
[err] npm error notsup Not compatible with your version of node/npm: @azure/msal-node@1.18.3
[err] npm error notsup Required: {"node":"10 || 12 || 14 || 16 || 18"}
[err] npm error notsup Actual: {"npm":"10.8.2","node":"v20.18.1"}

Does anyone of you happen to know a MySQL package compatible with the recommended node version 20?

I don't think that is anything to do with those Nodes.

the Nodes (and their dependencies), make no reference to that module.

marcusdavies@ /Users/marcusdavies
├─┬ node-red-mysql-r2@1.3.0
│ └─┬ mysql@2.18.1
│   ├── bignumber.js@9.0.0
│   ├─┬ readable-stream@2.3.7
│   │ ├── core-util-is@1.0.3
│   │ ├── inherits@2.0.4
│   │ ├── isarray@1.0.0
│   │ ├── process-nextick-args@2.0.1
│   │ ├── safe-buffer@5.1.2 deduped
│   │ ├─┬ string_decoder@1.1.1
│   │ │ └── safe-buffer@5.1.2 deduped
│   │ └── util-deprecate@1.0.2
│   ├── safe-buffer@5.1.2
│   └── sqlstring@2.3.1
└─┬ node-red-node-mysql@2.0.0
  └─┬ mysql2@3.11.5
    ├── aws-ssl-profiles@1.1.2
    ├── denque@2.1.0
    ├─┬ generate-function@2.3.1
    │ └── is-property@1.0.2
    ├─┬ iconv-lite@0.6.3
    │ └── safer-buffer@2.1.2
    ├── long@5.2.3
    ├── lru.min@1.1.1
    ├─┬ named-placeholders@1.1.3
    │ └── lru-cache@7.18.3
    ├── seq-queue@0.0.5
    └── sqlstring@2.3.3

You have something else causing that error.

  • Check your Node RED package.json file.
  • Run npm ls @azure/msal-node under your .node-red directory.

You have something trying to use it - its not the nodes you listed,

node-red-node-mysql - is the one to use BTW

EDIT


I think you have installed node-red-contrib-mssql-plus - which does use it.

marcusdavies@ /Users/marcusdavies
└─┬ node-red-contrib-mssql-plus@0.12.2
  └─┬ mssql@10.0.4
    └─┬ tedious@16.7.1
      └─┬ @azure/identity@3.4.2
        └── @azure/msal-node@2.16.2

MySQL is not MsSQL
MsSQL is not MySQL

Been using this for quite some years now, without any issue with all recent versions of node-red.

Thank you both!

@marcus-j-davies,
Yes, I do use node-red-contrib-mssql-plus.

I'm sorry, if that is a stupid question, but when I'm trying to install node-red-node-mysql and this node-red-node-mysql package is not related to @azure/msal-node@1.18.3, how is it possible that this comes up with an error message and stops installing?

This is the full message (the one before was shortened):

2024-12-15T15:45:40.781Z Install : node-red-node-mysql 2.0.0

2024-12-15T15:45:39.687Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict node-red-node-mysql@2.0.0
2024-12-15T15:45:41.174Z [err] npm error code EBADENGINE
2024-12-15T15:45:41.174Z [err] npm error engine Unsupported engine
2024-12-15T15:45:41.175Z [err] npm error engine Not compatible with your version of node/npm: @azure/msal-node@1.18.3
2024-12-15T15:45:41.175Z [err] npm error notsup Not compatible with your version of node/npm: @azure/msal-node@1.18.3
2024-12-15T15:45:41.175Z [err] npm error notsup Required: {"node":"10 || 12 || 14 || 16 || 18"}
2024-12-15T15:45:41.175Z [err] npm error notsup Actual:   {"npm":"10.8.2","node":"v20.18.1"}
2024-12-15T15:45:41.176Z [err] npm error A complete log of this run can be found in: /home/nr-user/.npm/_logs/2024-12-15T15_45_39_753Z-debug-0.log
2024-12-15T15:45:41.186Z rc=1

This is the contents of /home/nr-user/.npm/_logs/2024-12-15T15_45_39_753Z-debug-0.log

0 verbose cli /usr/bin/node /usr/bin/npm
1 info using npm@10.8.2
2 info using node@v20.18.1
3 silly config load:file:/usr/lib/node_modules/npm/npmrc
4 silly config load:file:/home/nr-user/.node-red/.npmrc
5 silly config load:file:/home/nr-user/.npmrc
6 silly config load:file:/usr/etc/npmrc
7 verbose title npm install node-red-node-mysql@2.0.0
8 verbose argv "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix" "~" "--omit" "dev" "--engine-strict" "node-red-node-mysql@2.0.0"
9 verbose logfile logs-max:10 dir:/home/nr-user/.npm/_logs/2024-12-15T15_45_39_753Z-
10 verbose logfile /home/nr-user/.npm/_logs/2024-12-15T15_45_39_753Z-debug-0.log
11 silly packumentCache heap:2197815296 maxSize:549453824 maxEntrySize:274726912
12 silly logfile done cleaning log files
13 silly idealTree buildDeps
14 silly fetch manifest node-red-node-mysql@2.0.0
15 silly packumentCache full:https://registry.npmjs.org/node-red-node-mysql cache-miss
16 http fetch GET 200 https://registry.npmjs.org/node-red-node-mysql 369ms (cache revalidated)
17 silly packumentCache full:https://registry.npmjs.org/node-red-node-mysql set size:100960 disposed:false
18 silly placeDep ROOT node-red-node-mysql@2.0.0 OK for: node-red-project@0.0.1 want: 2.0.0
19 silly fetch manifest mysql2@^3.6.5
20 silly packumentCache full:https://registry.npmjs.org/mysql2 cache-miss
21 http fetch GET 200 https://registry.npmjs.org/mysql2 47ms (cache revalidated)
22 silly packumentCache full:https://registry.npmjs.org/mysql2 set size:494581 disposed:false
23 silly placeDep ROOT mysql2@3.11.5 OK for: node-red-node-mysql@2.0.0 want: ^3.6.5
24 silly fetch manifest long@^5.2.1
25 silly packumentCache full:https://registry.npmjs.org/long cache-miss
26 http fetch GET 200 https://registry.npmjs.org/long 44ms (cache revalidated)
27 silly packumentCache full:https://registry.npmjs.org/long set size:71148 disposed:false
28 silly fetch manifest denque@^2.1.0
29 silly packumentCache full:https://registry.npmjs.org/denque cache-miss
30 http fetch GET 200 https://registry.npmjs.org/denque 50ms (cache revalidated)
31 silly packumentCache full:https://registry.npmjs.org/denque set size:62908 disposed:false
32 silly fetch manifest lru.min@^1.0.0
33 silly packumentCache full:https://registry.npmjs.org/lru.min cache-miss
34 http fetch GET 200 https://registry.npmjs.org/lru.min 64ms (cache revalidated)
35 silly packumentCache full:https://registry.npmjs.org/lru.min set size:42329 disposed:false
36 silly fetch manifest seq-queue@^0.0.5
37 silly packumentCache full:https://registry.npmjs.org/seq-queue cache-miss
38 http fetch GET 200 https://registry.npmjs.org/seq-queue 42ms (cache revalidated)
39 silly packumentCache full:https://registry.npmjs.org/seq-queue set size:10958 disposed:false
40 silly fetch manifest sqlstring@^2.3.2
41 silly packumentCache full:https://registry.npmjs.org/sqlstring cache-miss
42 http fetch GET 200 https://registry.npmjs.org/sqlstring 53ms (cache revalidated)
43 silly packumentCache full:https://registry.npmjs.org/sqlstring set size:31678 disposed:false
44 silly fetch manifest aws-ssl-profiles@^1.1.1
45 silly packumentCache full:https://registry.npmjs.org/aws-ssl-profiles cache-miss
46 http fetch GET 200 https://registry.npmjs.org/aws-ssl-profiles 65ms (cache revalidated)
47 silly packumentCache full:https://registry.npmjs.org/aws-ssl-profiles set size:13721 disposed:false
48 silly fetch manifest generate-function@^2.3.1
49 silly packumentCache full:https://registry.npmjs.org/generate-function cache-miss
50 http fetch GET 200 https://registry.npmjs.org/generate-function 43ms (cache revalidated)
51 silly packumentCache full:https://registry.npmjs.org/generate-function set size:22290 disposed:false
52 silly fetch manifest named-placeholders@^1.1.3
53 silly packumentCache full:https://registry.npmjs.org/named-placeholders cache-miss
54 http fetch GET 200 https://registry.npmjs.org/named-placeholders 51ms (cache revalidated)
55 silly packumentCache full:https://registry.npmjs.org/named-placeholders set size:17099 disposed:false
56 silly placeDep ROOT aws-ssl-profiles@1.1.2 OK for: mysql2@3.11.5 want: ^1.1.1
57 silly placeDep ROOT denque@2.1.0 OK for: mysql2@3.11.5 want: ^2.1.0
58 silly placeDep ROOT generate-function@2.3.1 OK for: mysql2@3.11.5 want: ^2.3.1
59 silly placeDep ROOT long@5.2.3 OK for: mysql2@3.11.5 want: ^5.2.1
60 silly placeDep ROOT lru.min@1.1.1 OK for: mysql2@3.11.5 want: ^1.0.0
61 silly placeDep ROOT named-placeholders@1.1.3 OK for: mysql2@3.11.5 want: ^1.1.3
62 silly placeDep ROOT seq-queue@0.0.5 OK for: mysql2@3.11.5 want: ^0.0.5
63 silly placeDep ROOT sqlstring@2.3.3 OK for: mysql2@3.11.5 want: ^2.3.2
64 silly fetch manifest is-property@^1.0.2
65 silly packumentCache full:https://registry.npmjs.org/is-property cache-miss
66 http fetch GET 200 https://registry.npmjs.org/is-property 59ms (cache revalidated)
67 silly packumentCache full:https://registry.npmjs.org/is-property set size:6745 disposed:false
68 silly fetch manifest lru-cache@^7.14.1
69 silly packumentCache full:https://registry.npmjs.org/lru-cache cache-miss
70 http fetch GET 200 https://registry.npmjs.org/lru-cache 43ms (cache revalidated)
71 silly packumentCache full:https://registry.npmjs.org/lru-cache set size:387720 disposed:false
72 silly placeDep ROOT is-property@1.0.2 OK for: generate-function@2.3.1 want: ^1.0.2
73 silly placeDep node_modules/named-placeholders lru-cache@7.18.3 OK for: named-placeholders@1.1.3 want: ^7.14.1
74 verbose stack Error: Unsupported engine
74 verbose stack     at checkEngine (/usr/lib/node_modules/npm/node_modules/npm-install-checks/lib/index.js:14:25)
74 verbose stack     at #checkEngineAndPlatform (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:198:11)
74 verbose stack     at Arborist.buildIdealTree (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:184:41)
74 verbose stack     at async Promise.all (index 1)
74 verbose stack     at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
74 verbose stack     at async Install.exec (/usr/lib/node_modules/npm/lib/commands/install.js:150:5)
74 verbose stack     at async Npm.exec (/usr/lib/node_modules/npm/lib/npm.js:207:9)
74 verbose stack     at async module.exports (/usr/lib/node_modules/npm/lib/cli/entry.js:74:5)
75 verbose pkgid @azure/msal-node@1.18.3
76 error code EBADENGINE
77 error engine Unsupported engine
78 error engine Not compatible with your version of node/npm: @azure/msal-node@1.18.3
79 error notsup Not compatible with your version of node/npm: @azure/msal-node@1.18.3
79 error notsup Required: {"node":"10 || 12 || 14 || 16 || 18"}
79 error notsup Actual:   {"npm":"10.8.2","node":"v20.18.1"}
80 silly unfinished npm timer reify 1734277539971
81 silly unfinished npm timer reify:loadTrees 1734277539973
82 verbose cwd /home/nr-user/.node-red
83 verbose os Linux 5.4.0-196-generic
84 verbose node v20.18.1
85 verbose npm  v10.8.2
86 verbose exit 1
87 verbose code 1
88 error A complete log of this run can be found in: /home/nr-user/.npm/_logs/2024-12-15T15_45_39_753Z-debug-0.log

The output you requested ( npm ls @azure/msal-node):

nr-user@sb-srv002:/home/nr-user/.node-red# npm ls @azure/msal-node
node-red-project@0.0.1 /home/nr-user/.node-red
└─┬ node-red-contrib-mssql-plus@0.12.1
  └─┬ mssql@10.0.1
    └─┬ tedious@16.5.0
      └─┬ @azure/identity@2.1.0
        └── @azure/msal-node@1.18.3

Upgrade the Mssql node to the latest version.

I just noticed I can't install or update any package.
(node-red-contrib-mssql-plus@0.12.1 included)

I'll try to get rid of that package and I'll keep you posted.

Uninstalling node-red-contrib-mssql-plus fixed it.
I didn't know a failing pakage's dependency is causing the whole install system to no longer install/update anything until the package with the failing dependeny has been removed.

So apologies for the confusion, this issue was not at all related to MySQL packages.

Upgrading to the latest version would probably have fixed it.

Hi @Colin,
Like I wrote, it didn't let me update. But I only tried via GUI/Palette.
Is there another way that might/would have worked?

Exactly how did you try to update?

  1. Opened Node-RED "Manage palette"
  2. Searched in the "Nodes" tab for the mssql package
  3. Clicked Update

I suspect the best approach is from the command line in ~/.node-red

npm remove node-red-contrib-mssql-plus
npm install node-red-node-mysql

And (if you really must)

npm install node-red-contrib-mssql-plus