# Testing a node locally

**URL:** <https://discourse.nodered.org/t/testing-a-node-locally/6688>\
**Category:** General\
**Created:** [11 January 2019 09:57 UTC](https://discourse.nodered.org/t/testing-a-node-locally/6688 "2019-01-11T09:57:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [11 January 2019 09:57 UTC](https://discourse.nodered.org/t/testing-a-node-locally/6688/1 "2019-01-11T09:57:38Z")

</div>

Rather than publishing my new node, I followed the [node-red packaging guide](https://nodered.org/docs/creating-nodes/packaging) to test the node locally, but I can't get it to display in my node-RED palette, and seeing strange npm behaviour.  
npm v6.4.1  
node-RED v 0.19.5  
Node.js version: v8.12.0

I made a few early mistakes initially by calling the node 'node-red-contrib- **RFM69Pi-Decoder**' (note upper-case), but later changed it to 'node-red-contrib- **rfm69pi-decoder**'. However, when I try and link the node, I get;

```auto
pi@raspberrypi:~/.node-red $ npm install /home/pi/testnode/node-red-contrib-rfm69pi-decoder
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-rfm69pi-decoder@0.0.2
added 3 packages from 1 contributor and audited 1425 packages in 54.756s
found 23 vulnerabilities (3 low, 12 moderate, 8 high)
  run `npm audit fix` to fix them, or `npm audit` for details

```

...which looks good, but after a NR stop/start, the node does not appear in the palette, and if I look in `~/.node-red/node_modules`, I see;  
 ![nr](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5e00f9498fdadc9983e85b2caa636fb2f260c16b.png) - NOTE - **node-red-contrib-RFM69Pi-Decoder.**

So I deleted both 'node-red-contrib- **RFM69Pi-Decoder**' & 'node-red-contrib- **rfm69pi-decoder**' and cleaned the npm cache -`npm cache clean --force` and tried again, and got exactly the same result.

Where is it getting 'node-red-contrib- **RFM69Pi-Decoder**' from?? It's not mentioned in any of my node files, and why isn't my node displayed in the palette?

---

<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:** [11 January 2019 10:02 UTC](https://discourse.nodered.org/t/testing-a-node-locally/6688/2 "2019-01-11T10:02:44Z")

</div>

Is `node-red-contrib-RFM69Pi-Decoder` still mentioned in your package.json ? If you didn't use `npm remove` to remove it, then it will still be in your package.json file and npm will be reinstalling it for you.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [11 January 2019 10:17 UTC](https://discourse.nodered.org/t/testing-a-node-locally/6688/3 "2019-01-11T10:17:55Z")

</div>

> [@knolleary](#):
>
> Is `node-red-contrib-RFM69Pi-Decoder` still mentioned in your package.json ?

No, it is not mentioned.

> [@knolleary](#):
>
> If you didn't use `npm remove` to remove it, then it will still be in your package.json file and npm will be reinstalling it for you

No, I didn't use `npm remove`, so manually remove the entry from `.node-red/package.json`?

---

<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:** [11 January 2019 10:19 UTC](https://discourse.nodered.org/t/testing-a-node-locally/6688/4 "2019-01-11T10:19:55Z")

</div>

> [@Paul-Reed](#):
>
> No, it is not mentioned.

> [@Paul-Reed](#):
>
> so manually remove the entry from `.node-red/package.json` ?

We may have crossed our wires on which package.json I was referring to in my first question. I was asking about `.node-red/package.json`. If it is mentioned in that file, remove it.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [11 January 2019 10:35 UTC](https://discourse.nodered.org/t/testing-a-node-locally/6688/5 "2019-01-11T10:35:36Z")

</div>

That has sorted the package.json issue OK, thanks.

However my node is still not being displayed in the palette.  
I've npm removed it, and npm re-installed it, and the node-red-log now shows;

`11 Jan 10:27:35 - [warn] [node-red-contrib-rfm69pi-decoder/rfm69pi-decoder] SyntaxError: missing ) after argument list`

Do you know which file this error refers to, or is it a case of again hunting for a syntax error throughout all of the node's files

---

<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:** [11 January 2019 10:38 UTC](https://discourse.nodered.org/t/testing-a-node-locally/6688/6 "2019-01-11T10:38:42Z")

</div>

> [@Paul-Reed](#):
>
> Do you know which file this error refers to

It will be under whatever `rfm69pi-decoder` points at in your package.json.

Your IDE ought to help you find a syntax error in the file - it isn't a runtime error.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [11 January 2019 10:54 UTC](https://discourse.nodered.org/t/testing-a-node-locally/6688/7 "2019-01-11T10:54:10Z")

</div>

Thanks, ~~found it~~ found them!  
Silly errors that I should have spotted earlier.
