Node-red-contrib-oauth2 not able to install or load

I am having difficulty installing node-red-contrib-oauth2. my stats are as follows:

  • Node-Red version 3.02
  • Node v18.16.0
  • NPM v9.5.1
  • OS Ubuntu 20.04.6 LTS

Additional notes form Log trying to install:
2023-06-20T18:16:22.628Z Install : node-red-contrib-oauth2 5.0.4

2023-06-20T18:16:21.919Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-oauth2@5.0.4

2023-06-20T18:16:26.663Z [err] npm

2023-06-20T18:16:26.664Z [err] WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

2023-06-20T18:16:27.149Z [err] npm

2023-06-20T18:16:27.149Z [err] ERR! code ENOTSUP

2023-06-20T18:16:27.151Z [err] npm

2023-06-20T18:16:27.151Z [err] ERR! notsup

2023-06-20T18:16:27.151Z [err] Unsupported engine for node-red-contrib-oauth2@5.0.4: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})

2023-06-20T18:16:27.151Z [err] npm

2023-06-20T18:16:27.151Z [err] ERR! notsup Not compatible with your version of node/npm: node-red-contrib-oauth2@5.0.4

2023-06-20T18:16:27.152Z [err] npm

2023-06-20T18:16:27.152Z [err] ERR!

2023-06-20T18:16:27.152Z [err] notsup Not compatible with your version of node/npm: node-red-contrib-oauth2@5.0.4

2023-06-20T18:16:27.152Z [err] npm

2023-06-20T18:16:27.152Z [err] ERR! notsup

2023-06-20T18:16:27.152Z [err] Required: {"node":">=12.0.0"}

2023-06-20T18:16:27.152Z [err] npm ERR!

2023-06-20T18:16:27.152Z [err] notsup Actual: {"npm":"6.14.4","node":"10.19.0"}

2023-06-20T18:16:27.158Z [err]

2023-06-20T18:16:27.158Z [err] npm ERR! A complete log of this run can be found in:

2023-06-20T18:16:27.158Z [err] npm

2023-06-20T18:16:27.158Z [err] ERR! /root/.npm/_logs/2023-06-20T18_16_27_154Z-debug.log

2023-06-20T18:16:27.178Z rc=1

According to this, you do not have node v18.

Perhaps you have n or nvm installed causing your system to report different versions?

Let me check more, I know older node packages where not managed by NVM. When ask NVM here is what I get (with only v18 under management by nvm):

root@ubrobot1:/home/cleararmor# nvm ls
-> v18.16.0
system
default -> 18.16.0 (-> v18.16.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.16.0) (default)
stable -> 18.16 (-> v18.16.0) (default)
lts/* -> lts/hydrogen (-> v18.16.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.0 (-> N/A)
lts/hydrogen -> v18.16.0

my guess the logs point to erroneous information, but I could be wrong. if I use an ls command I get:

root@ubrobot1:~# ls -la /usr/bin/node*
-rwxr-xr-x 1 root root 14416 Mar 31 2020 /usr/bin/node
lrwxrwxrwx 1 root root 40 Mar 7 2020 /usr/bin/node-gyp -> ../share/nodejs/node-gyp/bin/node-gyp.js
lrwxrwxrwx 1 root root 4 Mar 31 2020 /usr/bin/nodejs -> node


**to add more context when I isue a node-red --version command
root@ubrobot1:~/.nvm/versions/node/v18.16.0# node-red --version 20 Jun 22:04:33 - [info]

Welcome to Node-RED

20 Jun 22:04:33 - [info] Node-RED version: v3.0.2
20 Jun 22:04:33 - [info] Node.js version: v18.16.0
20 Jun 22:04:33 - [info] Linux 5.4.0-152-generic x64 LE
20 Jun 22:04:34 - [info] Loading palette nodes
20 Jun 22:04:36 - [info] Settings file : /root/.node-red/settings.js
20 Jun 22:04:36 - [info] Context store : 'default' [module=memory]
20 Jun 22:04:36 - [info] User directory : /root/.node-red
20 Jun 22:04:36 - [warn] Projects disabled : editorTheme.projects.enabled=false
20 Jun 22:04:36 - [info] Flows file : /root/.node-red/flows.json

The problem is a combination of running root and nvm.

Search the forum for those 2 terms - this is a common problem & not a node-red problem so to speak.

In short, get rid of nvm & don't run (or install) node-red as root.

OK...I did a 100% fresh install on ubuntu 20lts node

  1. node -v = v18.16.1
  2. npm -v = 9.5.1
  3. which node-red = /usr/local/bin/node-red
  4. nvm ls = v1.16.1 (that's it no other node installed, none)
  5. node-red version = 3.02
  6. turns out if you search...there is an erroneous error about the wrong version of node installed...wrong way, dead end...doesn't exist,..that's not it....zero, zilch, nada
  7. https works, passwords work, archival to sql server,

here is the install log for OAuth2....and again..the v10 is a red herring it is an erroneous error
2023-06-23T01:00:07.457Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-oauth2@5.0.4

2023-06-23T01:00:10.182Z [err] npm

2023-06-23T01:00:10.183Z [err] ERR! code ENOTSUP

2023-06-23T01:00:10.185Z [err] npm

2023-06-23T01:00:10.185Z [err] ERR!

2023-06-23T01:00:10.185Z [err] notsup

2023-06-23T01:00:10.186Z [err] Unsupported engine for node-red-contrib-oauth2@5.0.4: wanted: {"node":">=12.0.0"} (current: {"node":"10.19.0","npm":"6.14.4"})

2023-06-23T01:00:10.186Z [err] npm

2023-06-23T01:00:10.186Z [err] ERR!

2023-06-23T01:00:10.186Z [err] notsup Not compatible with your version of node/npm: node-red-contrib-oauth2@5.0.4

2023-06-23T01:00:10.186Z [err] npm

2023-06-23T01:00:10.186Z [err] ERR!

2023-06-23T01:00:10.186Z [err] notsup Not compatible with your version of node/npm: node-red-contrib-oauth2@5.0.4

2023-06-23T01:00:10.186Z [err] npm ERR!

2023-06-23T01:00:10.187Z [err] notsup

2023-06-23T01:00:10.187Z [err] Required: {"node":">=12.0.0"}

2023-06-23T01:00:10.187Z [err] npm

2023-06-23T01:00:10.187Z [err] ERR! notsup

2023-06-23T01:00:10.187Z [err] Actual: {"npm":"6.14.4","node":"10.19.0"}

2023-06-23T01:00:10.194Z [err]

2023-06-23T01:00:10.194Z [err] npm

2023-06-23T01:00:10.194Z [err] ERR! A complete log of this run can be found in:

2023-06-23T01:00:10.194Z [err] npm

2023-06-23T01:00:10.194Z [err] ERR! /home/xxxx/.npm/_logs/2023-06-23T01_00_10_189Z-debug.log

2023-06-23T01:00:10.213Z rc=1

Uninstall nvm


Did you use the official node-red install script to install Node-RED?

Did you use root or sudo when you installed node-red?

Are you running node-red as root or regular user?

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