# Express deprecated res.status("200") - Should not be String in Response Node at Status Code Prop

**URL:** <https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418>\
**Category:** General\
**Tags:** http-request\
**Created:** [19 December 2022 12:38 UTC](https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418 "2022-12-19T12:38:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MeGusta](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@MeGusta](https://discourse.nodered.org/u/MeGusta)\
**Post date:** [19 December 2022 12:38 UTC](https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418/1 "2022-12-19T12:38:43Z")

</div>

Same as : [Strange log line](https://discourse.nodered.org/t/strange-log-line/67430)

From time to time I get the Warnung :  
`express deprecated res.status("200"): use res.status(200) instead at`

It comes from the http Response Node :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c7612f4554293cab23b46f161d38cb35f84c517d.png)

I set there a Status Code (without quotation) but in the flows.json is it store as a String:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a2e411539308c440fda3d99df72a721e09a18a16.png)

NodeRed 3.0.2  
Node: 19.2.0  
Npm:9.1.3

---

<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:** [19 December 2022 13:28 UTC](https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418/2 "2022-12-19T13:28:56Z")

</div>

Does it happen if you use a supported version of nodejs - 14, 16, or 18?

---

<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:** [19 December 2022 13:52 UTC](https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418/3 "2022-12-19T13:52:45Z")

</div>

Node-RED is currently only tested (automation tests) against Node JS 14 and 16.

So I would personally not use NodeJS 18 unless you have a specific requirement.

YMMV

---

<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:** [19 December 2022 13:54 UTC](https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418/4 "2022-12-19T13:54:35Z")

</div>

This is ExpressJS not Node.js - string status codes have been deprecated for a while. They should be an integer.

---

<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:** [19 December 2022 14:17 UTC](https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418/5 "2022-12-19T14:17:20Z")

</div>

> [@Steve-Mcl](#):
>
> Node-RED is currently only tested (automation tests) against Node JS 14 and 16.
> 
> So I would personally not use NodeJS 18 unless you have a specific requirement.

[This page](https://nodered.org/docs/faq/node-versions) says that 18 is supported, with 16 recommended. That does not necessarily conflict with your statement I know.

---

<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:** [19 December 2022 15:07 UTC](https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418/6 "2022-12-19T15:07:20Z")

</div>

As @TotallyInformation says, this is related to express, the version of node.js is not relevant.

@MeGusta can you raise an issue? We really should be ensuring this is a number to avoid the warning message.

---

<div class="post-metadata">

**Author:** ![MeGusta](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@MeGusta](https://discourse.nodered.org/u/MeGusta)\
**Post date:** [20 December 2022 09:37 UTC](https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418/7 "2022-12-20T09:37:38Z")

</div>

It's a known issue and will be fixed in the next release:

> <https://github.com/node-red/node-red/pull/3894>
>
> Fixes #3893
> 
> Used parseInt instead of the suggested fix so that we don't end u…p with statusCode = 200.5
> 
> \<!--
> \## Before you hit that Submit button....
> 
> Please read our \[contribution guidelines\](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md)
> before submitting a pull-request.
> 
> \## Types of changes
> 
> What types of changes does your code introduce?
> Put an \`x\` in the boxes that apply
> \--\>
> 
> \- \[x\] Bugfix (non-breaking change which fixes an issue)
> \- \[\] New feature (non-breaking change which adds functionality)
> 
> \<!--
> If you want to raise a pull-request with a new feature, or a refactoring
> of existing code, it \*\*may well get rejected\*\* if it hasn't been discussed on
> the \[forum\](https://discourse.nodered.org) or
> \[slack team\](https://nodered.org/slack) first.
> 
> \--\>
> 
> \## Proposed changes
> 
> 
> 
> \## Checklist
> 
> 
> \- \[x\] I have read the \[contribution guidelines\](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md)
> \- \[\] For non-bugfix PRs, I have discussed this change on the forum/slack team.
> \- \[x\] I have run \`grunt\` to verify the unit tests pass
> \- \[\] I have added suitable unit tests to cover the new/changed functionality

---

<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 February 2023 09:37 UTC](https://discourse.nodered.org/t/express-deprecated-res-status-200-should-not-be-string-in-response-node-at-status-code-prop/72418/8 "2023-02-18T09:37:45Z")

</div>

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