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

**URL:** https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329
**Category:** General
**Created:** [20 June 2023 18:15 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329 "2023-06-20T18:15:30Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![cabh](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@cabh](https://discourse.nodered.org/u/cabh)
#### Post date: [20 June 2023 18:15 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329/1 "2023-06-20T18:15:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [20 June 2023 19:40 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329/2 "2023-06-20T19:40:58Z")

</div>

> [@cabh](#):
>
> [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"}

According to this, you do not have node v18.

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

---

<div class="post-metadata">

### Author: ![cabh](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@cabh](https://discourse.nodered.org/u/cabh)
#### Post date: [20 June 2023 21:38 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329/3 "2023-06-20T21:38:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cabh](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@cabh](https://discourse.nodered.org/u/cabh)
#### Post date: [20 June 2023 21:44 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329/4 "2023-06-20T21:44:02Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cabh](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@cabh](https://discourse.nodered.org/u/cabh)
#### Post date: [20 June 2023 22:05 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329/5 "2023-06-20T22:05:37Z")

</div>

> [@cabh](#):
>
> 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"})

* * *

\*\*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

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [20 June 2023 22:09 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329/6 "2023-06-20T22:09:57Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![cabh](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@cabh](https://discourse.nodered.org/u/cabh)
#### Post date: [23 June 2023 01:01 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329/7 "2023-06-23T01:01:50Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [23 June 2023 05:41 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329/8 "2023-06-23T05:41:04Z")

</div>

> [@cabh](#):
>
> nvm ls = v1.16.1 (that's it no other node installed, none)

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?

---

<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: [22 August 2023 05:41 UTC](https://discourse.nodered.org/t/node-red-contrib-oauth2-not-able-to-install-or-load/79329/9 "2023-08-22T05:41:49Z")

</div>

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