# Error in installing node-red-contrib-tf-model

**URL:** https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268
**Category:** General
**Created:** [15 October 2021 15:01 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268 "2021-10-15T15:01:35Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![norahb](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@norahb](https://discourse.nodered.org/u/norahb)
#### Post date: [15 October 2021 15:01 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/1 "2021-10-15T15:01:35Z")

</div>

Hello  
Whenever I try to install  
node-red-contrib-tf-model  
I get this error

```auto
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: node-red-project@0.0.1
npm ERR! Found: @tensorflow/tfjs-node@3.9.0
npm ERR! node_modules/@tensorflow/tfjs-node
npm ERR! @tensorflow/tfjs-node@"^3.9.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @tensorflow/tfjs-node@"^1.4.0" from node-red-contrib-tf-model@0.1.11
npm ERR! node_modules/node-red-contrib-tf-model
npm ERR! node-red-contrib-tf-model@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!

I tried to delete all tensorflow folders from node-red but it did not work.
```

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [15 October 2021 16:39 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/2 "2021-10-15T16:39:48Z")

</div>

Did you install the prerequisites as defined on the [node's page](https://flows.nodered.org/node/node-red-contrib-tf-model)?

---

<div class="post-metadata">

### Author: ![norahb](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@norahb](https://discourse.nodered.org/u/norahb)
#### Post date: [15 October 2021 16:54 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/3 "2021-10-15T16:54:14Z")

</div>

I did.. Inside node-red folder

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [15 October 2021 21:56 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/4 "2021-10-15T21:56:39Z")

</div>

What platform are you running node-red on?  
What version of NR and node.js (you can get this from the start up log)

(Sorry I took so long to get back to - family matters)

---

<div class="post-metadata">

### Author: ![norahb](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@norahb](https://discourse.nodered.org/u/norahb)
#### Post date: [17 October 2021 10:34 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/5 "2021-10-17T10:34:24Z")

</div>

No worries..  
I run it on Mac and  
[info] Node-RED version: v2.0.5  
[info] Node.js version: v16.11.1

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [17 October 2021 10:52 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/6 "2021-10-17T10:52:30Z")

</div>

On my mac - running node.js 14.16.0 - I opened a terminal window and ran

```auto
cd .node-red
npm install @tensorflow/tfjs-node
npm install node-red-contrib-tf-model

```

and it seemed to import fine. So it may be a node.js version issue.  
What version of macOS are you running and what type of Mac are you using?

Note - I do get this when NR starts up:

```auto
17 Oct 06:53:50 - [warn] ------------------------------------------------------
17 Oct 06:53:50 - [warn] [node-red-contrib-tf-model/tf-model] TypeError: Cannot read property 'whereImpl' of undefined
17 Oct 06:53:50 - [warn] ------------------------------------------------------

```

---

<div class="post-metadata">

### Author: ![norahb](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@norahb](https://discourse.nodered.org/u/norahb)
#### Post date: [17 October 2021 12:36 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/7 "2021-10-17T12:36:44Z")

</div>

I have macOS Big Sur 11.6 on Macbook air 2017.  
I updated the version on Node.js, but still getting the same error when I run

```auto
npm install node-red-contrib-tf-model

```

I tried to run

> npm audit fix

and got this

> fix available via `npm audit fix --force`  
> Will install node-red-contrib-tfjs-coco-ssd@0.5.0, which is a breaking change  
> node\_modules/node-fetch  
> @tensorflow/tfjs-core 1.1.0 - 2.4.0  
> Depends on vulnerable versions of node-fetch  
> node\_modules/@tensorflow/tfjs-core  
> node\_modules/node-red-contrib-tfjs-coco-ssd/node\_modules/@tensorflow/tfjs-core  
> @tensorflow-models/coco-ssd 1.1.0 - 2.0.3  
> Depends on vulnerable versions of @tensorflow/tfjs-core  
> node\_modules/@tensorflow-models/coco-ssd  
> node-red-contrib-tfjs-coco-ssd \*  
> Depends on vulnerable versions of @tensorflow-models/coco-ssd  
> Depends on vulnerable versions of @tensorflow/tfjs-node  
> node\_modules/node-red-contrib-tfjs-coco-ssd  
> @tensorflow/tfjs 0.14.0 - 2.4.0  
> Depends on vulnerable versions of @tensorflow/tfjs-core  
> Depends on vulnerable versions of @tensorflow/tfjs-data  
> node\_modules/node-red-contrib-tfjs-coco-ssd/node\_modules/@tensorflow/tfjs  
> @tensorflow/tfjs-node 1.1.0 - 2.4.0  
> Depends on vulnerable versions of @tensorflow/tfjs  
> node\_modules/node-red-contrib-tfjs-coco-ssd/node\_modules/@tensorflow/tfjs-node  
> @tensorflow/tfjs-converter 1.1.0 - 2.4.0  
> Depends on vulnerable versions of @tensorflow/tfjs-core  
> node\_modules/@tensorflow/tfjs-converter  
> node\_modules/node-red-contrib-tfjs-coco-ssd/node\_modules/@tensorflow/tfjs-converter  
> @tensorflow/tfjs-data \<=2.4.0  
> Depends on vulnerable versions of @tensorflow/tfjs-core  
> Depends on vulnerable versions of node-fetch  
> node\_modules/node-red-contrib-tfjs-coco-ssd/node\_modules/@tensorflow/tfjs/node\_modules/@tensorflow/tfjs-data  
> @tensorflow/tfjs-layers 1.1.0 - 2.4.0  
> Depends on vulnerable versions of @tensorflow/tfjs-core  
> node\_modules/node-red-contrib-tfjs-coco-ssd/node\_modules/@tensorflow/tfjs-layers

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [17 October 2021 12:48 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/8 "2021-10-17T12:48:25Z")

</div>

> [@norahb](#):
>
> I tried to run
> 
> > npm audit fix

Don't do that. It may break your system.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [17 October 2021 17:54 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/9 "2021-10-17T17:54:05Z")

</div>

> [@norahb](#):
>
> I updated the version on Node.js,

Did you update or downgrade? So what version of node.js are you now running? (just enter `node -v` in a terminal session)

I'm also running macOS v11.6 on a Mac mini (M1) running node v14.16.0  
Here is my install log:

```auto
Paul@Mac-mini ~ % cd .node-red
Paul@Mac-mini .node-red % npm install @tensorflow/tfjs-node

> @tensorflow/tfjs-node@3.9.0 install /Users/Paul/.node-red/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-darwin-3.9.0.tar.gz
* Downloading libtensorflow
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-2.5.0.tar.gz
[==============================] 14410884/bps 100% 0.0s
* Building TensorFlow Node.js bindings
npm WARN @tensorflow-models/mobilenet@2.1.0 requires a peer of @tensorflow/tfjs-converter@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow-models/mobilenet@2.1.0 requires a peer of @tensorflow/tfjs-core@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow-models/posenet@2.2.2 requires a peer of @tensorflow/tfjs-converter@^3.0.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow-models/posenet@2.2.2 requires a peer of @tensorflow/tfjs-core@^3.0.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN node-red-contrib-ui-led@0.4.9 requires a peer of node-red-dashboard@^2.23.3 but none is installed. You must install peer dependencies yourself.
npm WARN node-red-contrib-ui-mp4frag@0.1.0-beta.3 requires a peer of node-red-dashboard@^2.26.1 but none is installed. You must install peer dependencies yourself.
npm WARN xterm-addon-fit@0.3.0 requires a peer of xterm@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/tfjs-layers@3.9.0 requires a peer of @tensorflow/tfjs-core@3.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/tfjs-backend-webgl@3.9.0 requires a peer of @tensorflow/tfjs-core@3.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/tfjs-data@3.9.0 requires a peer of @tensorflow/tfjs-core@3.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/tfjs-backend-cpu@3.9.0 requires a peer of @tensorflow/tfjs-core@3.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ @tensorflow/tfjs-node@3.9.0
updated 1 package and audited 1246 packages in 19.13s

64 packages are looking for funding
  run `npm fund` for details

found 72 vulnerabilities (5 low, 24 moderate, 40 high, 3 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
Paul@Mac-mini .node-red % npm install node-red-contrib-tf-model        
npm WARN @tensorflow-models/mobilenet@2.1.0 requires a peer of @tensorflow/tfjs-converter@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow-models/mobilenet@2.1.0 requires a peer of @tensorflow/tfjs-core@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow-models/posenet@2.2.2 requires a peer of @tensorflow/tfjs-converter@^3.0.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow-models/posenet@2.2.2 requires a peer of @tensorflow/tfjs-core@^3.0.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/tfjs-backend-cpu@3.9.0 requires a peer of @tensorflow/tfjs-core@3.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/tfjs-backend-webgl@3.9.0 requires a peer of @tensorflow/tfjs-core@3.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/tfjs-data@3.9.0 requires a peer of @tensorflow/tfjs-core@3.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/tfjs-layers@3.9.0 requires a peer of @tensorflow/tfjs-core@3.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN node-red-contrib-ui-led@0.4.9 requires a peer of node-red-dashboard@^2.23.3 but none is installed. You must install peer dependencies yourself.
npm WARN node-red-contrib-ui-mp4frag@0.1.0-beta.3 requires a peer of node-red-dashboard@^2.26.1 but none is installed. You must install peer dependencies yourself.
npm WARN xterm-addon-fit@0.3.0 requires a peer of xterm@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN node-red-contrib-tf-model@0.1.11 requires a peer of @tensorflow/tfjs-node@^1.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ node-red-contrib-tf-model@0.1.11
added 1 package from 1 contributor and audited 1247 packages in 4.193s

68 packages are looking for funding
  run `npm fund` for details

found 72 vulnerabilities (5 low, 24 moderate, 40 high, 3 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
Paul@Mac-mini .node-red % 

```

---

<div class="post-metadata">

### Author: ![norahb](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@norahb](https://discourse.nodered.org/u/norahb)
#### Post date: [18 October 2021 11:04 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/10 "2021-10-18T11:04:08Z")

</div>

> [@norahb](#):
>
> node-red-contrib-tf-model

I have node.js version v16.11.1

should I try this command  
`npm install --legacy-peer-deps`  
??

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [18 October 2021 12:54 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/12 "2021-10-18T12:54:05Z")

</div>

> [@norahb](#):
>
> should I try this command  
> `npm install --legacy-peer-deps`

You can try anything you like, but it won't change the error you showed earlier, if indeed the error you are now getting is exactly the same.

To check that node\_modules is not messed up then rename the .node-red/node\_modules folder to something else, and in the .node-red folder run  
`npm install`  
(which may take some time) and, assuming that runs without error, then try installing the node again. If it fails then please post the full log including the command you entered.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [18 October 2021 14:48 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/13 "2021-10-18T14:48:55Z")

</div>

Can you downgrade node.js to v14.16.0?

---

<div class="post-metadata">

### Author: ![norahb](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@norahb](https://discourse.nodered.org/u/norahb)
#### Post date: [20 October 2021 08:51 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/14 "2021-10-20T08:51:52Z")

</div>

> [@norahb](#):
>
> `npm install --legacy-peer-deps`

I tried it and it worked. I will be using a new machine soon. So the temporary solution fine for me now.  
Thanks

---

<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: [19 December 2021 08:52 UTC](https://discourse.nodered.org/t/error-in-installing-node-red-contrib-tf-model/52268/15 "2021-12-19T08:52:05Z")

</div>

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