# Node-red-nodegen Help

**URL:** https://discourse.nodered.org/t/node-red-nodegen-help/3705
**Category:** Developing Nodes
**Created:** [5 October 2018 05:05 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705 "2018-10-05T05:05:04Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![mako](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mako](https://discourse.nodered.org/u/mako)
#### Post date: [5 October 2018 05:05 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/1 "2018-10-05T05:05:04Z")

</div>

Hello Chaps.  
I have been trying to get this Npm to work but not having to much look

> **[node-red-nodegen](https://www.npmjs.com/package/node-red-nodegen)**
>
> Node generator for Node-RED

**Using Example 2**  
Example 2. Create original node from function node (JavaScript code)

1. On Node-RED flow editor, save function node to library with file name (lower-case.js).
2. 

```
node-red-nodegen ~/.node-red/lib/function/lower-case.js

```

3. 

```
cd node-red-contrib-lower-case

```

4. 

```
sudo npm link

```

5. 

```
cd ~/.node-red

```

6. 

```
npm link node-red-contrib-lower-case

```

7. 

```
node-red

```

-\> You can use lower-case node on Node-RED flow editor.

I get to step 2. CMD shows an error :  
C:\Users\daniel.smith\>node-red-nodegen ~/.node-red/lib/function/lower-case.js  
Error: ENOENT: no such file or directory, open 'C:\Users\daniel.smith~.node-red\lib\function\lower-case.js'  
at Object.fs.openSync (fs.js:652:18)  
at Object.fs.readFileSync (fs.js:553:33)  
at Object. (C:\Users\daniel.smith\AppData\Roaming\npm\node\_modules\node-red-nodegen\bin\node-red-nodegen.js:122:27)  
at Module.\_compile (module.js:569:30)  
at Object.Module.\_extensions..js (module.js:580:10)  
at Module.load (module.js:503:32)  
at tryModuleLoad (module.js:466:12)  
at Function.Module.\_load (module.js:458:3)  
at Function.Module.runMain (module.js:605:10)  
at startup (bootstrap\_node.js:158:16)

I know for certain the path exists i can CD into it. Would anyone have any ideas on how im making this mistake ?

Using.  
Windows 7  
Latest Npm  
Lastest nodeJs  
Latest Node red  
Chrome Browser.

Thanks in advance

---

<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: [5 October 2018 06:20 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/2 "2018-10-05T06:20:01Z")

</div>

Try using the full path to the file instead of ~/

Or maybe try in powershell

---

<div class="post-metadata">

### Author: ![mako](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mako](https://discourse.nodered.org/u/mako)
#### Post date: [5 October 2018 07:40 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/3 "2018-10-05T07:40:48Z")

</div>

I did that and it didn't execute the app. it just said not recognise command.

When i follow hi method i get the log it pasted in the first post. I also checked the directories it supposedly generates the Npm package and they was empty.

Dan

---

<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: [5 October 2018 08:25 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/4 "2018-10-05T08:25:00Z")

</div>

I meant

```
node-red-nodegen C:\Users\daniel.smith\.node-red\lib\function\lower-case.js
```

---

<div class="post-metadata">

### Author: ![mako](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mako](https://discourse.nodered.org/u/mako)
#### Post date: [5 October 2018 11:59 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/5 "2018-10-05T11:59:32Z")

</div>

I meant that to. I typed exactly what you have typed, comes up with that same error.

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [5 October 2018 12:10 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/6 "2018-10-05T12:10:05Z")

</div>

Error: ENOENT: no such file or directory

If you navigate to the folder `C:\Users\daniel.smith\.node-red\lib\function\` do you have the `lower-case.js` in place?  
I think the path is there just as an example and you should point the the nodegen to the real file you need it to work on.

---

<div class="post-metadata">

### Author: ![mako](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mako](https://discourse.nodered.org/u/mako)
#### Post date: [6 October 2018 12:13 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/7 "2018-10-06T12:13:34Z")

</div>

Had word from author .  
Separator is wrong as I'm not using UNIX . Had to change for Windows.  
I'll let you know if it works !

---

<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: [6 October 2018 12:18 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/8 "2018-10-06T12:18:36Z")

</div>

> [@mako](#):
>
> Separator is wrong as I'm not using UNIX . Had to change for Windows.

Don't forget to escape back-slashes if putting the path in a string. `C:\\Users\\daniel.smith\\.node-red\\lib\\function\\`. Forward slashes work as well though on Windows so best to stick to those.

Ideally, you would use the NodeJS standard library function for path joins as that is much better at taking care of things but it means importing it.

---

<div class="post-metadata">

### Author: ![josekavunkal](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/josekavunkal/32/18505_2.png) [@josekavunkal](https://discourse.nodered.org/u/josekavunkal)
#### Post date: [22 February 2020 14:33 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/9 "2020-02-22T14:33:21Z")

</div>

I am getting Error: TypeError: Cannot read property 'match' of undefined when i run the same way as mentioned above.Any clue?

---

<div class="post-metadata">

### Author: ![AiKju](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aikju/32/20215_2.png) [@AiKju](https://discourse.nodered.org/u/AiKju)
#### Post date: [9 April 2020 14:04 UTC](https://discourse.nodered.org/t/node-red-nodegen-help/3705/10 "2020-04-09T14:04:13Z")

</div>

Hi, I do have the same problem. Anybody here with a solution?
