# Why i get error if I am using const?

**URL:** <https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036>\
**Category:** General\
**Created:** [18 March 2022 12:36 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036 "2022-03-18T12:36:39Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![muharremsari](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muharremsari/32/7996_2.png) [@muharremsari](https://discourse.nodered.org/u/muharremsari)\
**Post date:** [18 March 2022 12:36 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/1 "2022-03-18T12:36:39Z")

</div>

I get this error in module after node-red upgrade

'const' is available in es6 (use 'esversion 6') or mozilla js extensions (use moz)

pls help me

---

<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:** [18 March 2022 12:40 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/2 "2022-03-18T12:40:47Z")

</div>

You will need to give us a clue as to where you are seeing that error and what you are trying to do.

---

<div class="post-metadata">

**Author:** ![muharremsari](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muharremsari/32/7996_2.png) [@muharremsari](https://discourse.nodered.org/u/muharremsari)\
**Post date:** [18 March 2022 12:42 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/3 "2022-03-18T12:42:59Z")

</div>

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

---

<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:** [18 March 2022 12:44 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/4 "2022-03-18T12:44:35Z")

</div>

What version of Node-RED and Node.js are you using?

---

<div class="post-metadata">

**Author:** ![muharremsari](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muharremsari/32/7996_2.png) [@muharremsari](https://discourse.nodered.org/u/muharremsari)\
**Post date:** [18 March 2022 12:45 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/5 "2022-03-18T12:45:50Z")

</div>

Thanks for express answer

v1.3.4

---

<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:** [18 March 2022 12:50 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/6 "2022-03-18T12:50:11Z")

</div>

This is an ACE issue. (EDIT: Or rather more likely how that node uses ACE)

If you upgrade to latest node-red you can use the Monaco editor...

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/07d7c6c534a8ddfae323ec7823fa428039c383f2.jpeg "What's new in Node-RED 2.0") ](https://www.youtube.com/watch?v=eTEbqZcumz4)

---

<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 March 2022 13:31 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/7 "2022-03-18T13:31:19Z")

</div>

> [@Steve-Mcl](#):
>
> This is an ACE issue.

What is it about that particular example that causes the problem? I can use const with ACE without issues.

---

<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:** [18 March 2022 13:33 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/8 "2022-03-18T13:33:02Z")

</div>

It will probably be related to the instantiation parameters of the ACE editor by that node. (I haven't looked)

---

<div class="post-metadata">

**Author:** ![muharremsari](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muharremsari/32/7996_2.png) [@muharremsari](https://discourse.nodered.org/u/muharremsari)\
**Post date:** [18 March 2022 13:36 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/9 "2022-03-18T13:36:57Z")

</div>

I don't have Monaco editor in v1.3.4

---

<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:** [18 March 2022 13:37 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/10 "2022-03-18T13:37:52Z")

</div>

> [@muharremsari](#):
>
> I don't have Monaco editor in v1.3.4

👇 important bit 👇

> [@Steve-Mcl](#):
>
> If you upgrade to latest node-red you can use the Monaco editor

---

<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 March 2022 13:40 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/11 "2022-03-18T13:40:27Z")

</div>

> [@Steve-Mcl](#):
>
> It will probably be related to the instantiation parameters of the ACE editor by that node

OK, thanks.

---

<div class="post-metadata">

**Author:** ![muharremsari](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muharremsari/32/7996_2.png) [@muharremsari](https://discourse.nodered.org/u/muharremsari)\
**Post date:** [18 March 2022 13:41 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/12 "2022-03-18T13:41:30Z")

</div>

I was try latest release, but i have a lot of issue other flows and modules. I was able to reduce with this release

I m tired ☹

---

<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:** [18 March 2022 13:54 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/13 "2022-03-18T13:54:18Z")

</div>

You didn't say what version of Node.js you were using. That is also important.

---

<div class="post-metadata">

**Author:** ![muharremsari](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muharremsari/32/7996_2.png) [@muharremsari](https://discourse.nodered.org/u/muharremsari)\
**Post date:** [18 March 2022 13:58 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/15 "2022-03-18T13:58:19Z")

</div>

Sorry

v1.3.4

---

<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:** [18 March 2022 13:58 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/16 "2022-03-18T13:58:46Z")

</div>

No, that is the version of Node-RED. The version of Node.js is shown in the Node-RED log when you start Node-RED.

---

<div class="post-metadata">

**Author:** ![muharremsari](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/muharremsari/32/7996_2.png) [@muharremsari](https://discourse.nodered.org/u/muharremsari)\
**Post date:** [18 March 2022 14:07 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/17 "2022-03-18T14:07:13Z")

</div>

> [@TotallyInformation](#):
>
> No, that is the version of Node-RED. The version of Node.js is shown in the Node-RED log when you start Node-RED

node -v

v8.17.0

npm

6.13.4

---

<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:** [18 March 2022 14:14 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/18 "2022-03-18T14:14:13Z")

</div>

> [@muharremsari](#):
>
> node -v
> 
> v8.17.0

This is why you get problems with node-red 2.x

Node-red 2.x requires nodejs V12 minimum.

PS nodejs v8 is VERY OLD / unsupported as of `December 31, 2019`

---

<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:** [17 May 2022 14:14 UTC](https://discourse.nodered.org/t/why-i-get-error-if-i-am-using-const/60036/19 "2022-05-17T14:14:42Z")

</div>

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