# Cannot Install or update nodes EBADENGINE running node 16.x

**URL:** https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400
**Category:** General
**Created:** [2 June 2022 21:08 UTC](https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400 "2022-06-02T21:08:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mrSidX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrsidx/32/18935_2.png) [@mrSidX](https://discourse.nodered.org/u/mrSidX)
#### Post date: [2 June 2022 21:08 UTC](https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400/1 "2022-06-02T21:08:51Z")

</div>

I am unable to install any nodes, as they all seem to be failing. Not sure what I did along the way but I am getting this error:

```auto
-----------------------------------------------------------
2022-06-02T20:59:46.540Z Install : node-red-contrib-uibuilder 5.0.2

2022-06-02T20:59:45.972Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-uibuilder@5.0.2
2022-06-02T20:59:46.935Z [err] npm
2022-06-02T20:59:46.935Z [err]  
2022-06-02T20:59:46.936Z [err] WARN config production Use `--omit=dev` instead.
2022-06-02T20:59:53.287Z [err] npm
2022-06-02T20:59:53.287Z [err] ERR! code EBADENGINE
2022-06-02T20:59:53.289Z [err] npm ERR!
2022-06-02T20:59:53.289Z [err] engine Unsupported engine
2022-06-02T20:59:53.289Z [err] npm ERR! engine Not compatible with your version of node/npm: node-red-contrib-objectid@0.7.2
2022-06-02T20:59:53.289Z [err] npm 
2022-06-02T20:59:53.289Z [err] ERR! notsup Not compatible with your version of node/npm: node-red-contrib-objectid@0.7.2
2022-06-02T20:59:53.289Z [err] npm ERR! notsup Required: {"node":"^0.12.7"}
2022-06-02T20:59:53.289Z [err] npm ERR! notsup Actual: {"npm":"8.11.0","node":"v16.14.2"}
2022-06-02T20:59:53.291Z [err] 
2022-06-02T20:59:53.292Z [err] npm ERR!
2022-06-02T20:59:53.292Z [err] A complete log of this run can be found in:
2022-06-02T20:59:53.292Z [err] npm ERR! /home/ubuntu/.npm/_logs/2022-06-02T20_59_46_887Z-debug-0.log
2022-06-02T20:59:53.301Z rc=1

```

Requires node 0.12.7 ??  
Actual is 16.14.2

I haven't the slightest idea what is going on. I tend to get tangled in `npm` and versioning mess from time to time, if that's what it is. Any sound solutions to accommodate old and new node version requirements?

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [2 June 2022 21:15 UTC](https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400/2 "2022-06-02T21:15:43Z")

</div>

> [@mrSidX](#):
>
> `node-red-contrib-objectid`

You need to remove `node-red-contrib-objectid` - it requires node 0.12 which is not supported. It needs to be updated to not have such a limited engines requirement in its package.json - but as it hasn't been touched in 4 years, I'm not sure how likely that is to happen.

---

<div class="post-metadata">

### Author: ![mrSidX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrsidx/32/18935_2.png) [@mrSidX](https://discourse.nodered.org/u/mrSidX)
#### Post date: [4 June 2022 06:00 UTC](https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400/3 "2022-06-04T06:00:25Z")

</div>

Thanks Nick.

I'm kinda painted in a corner as my site is serving an animated film festival served via node-red.  
`streamtacular.com`  
Been working fine (so far) though the `mongodb` nodes I have requires the ObjectID object to pass to mongodb to query results.  
I would have to essentially remove, and seemingly implement a newer version of mongodb as well, that is harmonious with "modern" versioning.

I was curious if syntax isn't completely different, if possible to "spoof" the version in the `package.json`? and redeploy?

I'm curious the 'innards' as to what causes the termination and error of the npm updates; based on incompatible versions. Does it simply reference the provided version number? Or is there something more entwined?  
I want to avoid frankensteining my node-red / npm configs, though I am tempted due to my situation.

Thanks again for leading me in the right direction.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [4 June 2022 09:30 UTC](https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400/4 "2022-06-04T09:30:13Z")

</div>

Well - to get control of this - you can clone that node's repo and try editing the package.json to remove the restriction and then load the node from local directory. Of course if the restriction is there for a real reason then you would then also have to fix the code locally as well but at least then it is under your control.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [4 June 2022 14:22 UTC](https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400/5 "2022-06-04T14:22:01Z")

</div>

> [@mrSidX](#):
>
> node-red-contrib-objectid

Have you tried [node-red-contrib-bson (node) - Node-RED (nodered.org)](https://flows.nodered.org/node/node-red-contrib-bson) instead? I think it does the same thing but with updated code.

Update: Oops, they left the same restriction in the package.json, sorry.

Update2: The objectid and bson nodes are very simple wrappers around the npm `bson` package. So you could simply use a function node and load the bson library yourself.

---

<div class="post-metadata">

### Author: ![mrSidX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrsidx/32/18935_2.png) [@mrSidX](https://discourse.nodered.org/u/mrSidX)
#### Post date: [4 June 2022 20:48 UTC](https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400/6 "2022-06-04T20:48:25Z")

</div>

I'm assuming I need to adjust the `settings.js` file for this and add `bson` to the global modules section.

It appears I've tried and paused my efforts:

```auto
    functionGlobalContext: {
        os:require('os'),
        domtoimage:require('dom-to-image'),
        stripe:require('stripe'),
        objectid:require('bson').ObjectID
// flagpack:require('flagpack'),   
        //vimeo:require('vimeo'),
        // jfive:require("johnny-five"),
        // j5board:require("johnny-five").Board({repl:false})
    },

```

Now I just need to figure out what I need to do in the function node. Should be straight forward:

I'm thinking:

```auto
///msg.payload._id is an incoming string representing a mongodb ObjectID
const objectID = global.get('objectid');
msg.payload._id = objectID(msg.payload._id);

```

---

<div class="post-metadata">

### Author: ![mrSidX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrsidx/32/18935_2.png) [@mrSidX](https://discourse.nodered.org/u/mrSidX)
#### Post date: [4 June 2022 20:53 UTC](https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400/7 "2022-06-04T20:53:45Z")

</div>

> [@mrSidX](#):
>
> ```auto
> const objectID = global.get('objectid');
> msg.payload._id = objectID(msg.payload._id);
> 
> ```

OK So I did your suggestion and added the `functionGlobalContext` require of `bson` in `settings.js` and ran the code above before my mongo query. It is working and not affecting my site.

Thank you all.

---

<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: [18 June 2022 20:54 UTC](https://discourse.nodered.org/t/cannot-install-or-update-nodes-ebadengine-running-node-16-x/63400/8 "2022-06-18T20:54:10Z")

</div>

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