# Nbrower node : Saveas doesn't work?

**URL:** https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283
**Category:** General
**Created:** [26 January 2022 19:24 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283 "2022-01-26T19:24:55Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Lafayette](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@Lafayette](https://discourse.nodered.org/u/Lafayette)
#### Post date: [26 January 2022 19:24 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/1 "2022-01-26T19:24:55Z")

</div>

Hi i use this flow to save a web page into a pdf file :

```auto
[
    {
        "id": "129d963431e3975c",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a1c3b5dc9d7fc22e",
        "type": "nbrowser",
        "z": "129d963431e3975c",
        "name": "test",
        "methods": [
            {
                "name": "gotoURL",
                "func": "goto",
                "params": [
                    {
                        "type": "msg",
                        "value": "payload",
                        "typeDefault": "str"
                    }
                ]
            },
            {
                "name": "saveAs",
                "func": "saveAs",
                "params": [
                    {
                        "type": "saveAction",
                        "value": "pdf",
                        "typeDefault": "saveAction"
                    },
                    {
                        "type": "str",
                        "value": "/data/pdf/test.pdf",
                        "typeDefault": "str"
                    }
                ]
            }
        ],
        "prop": "nbrowser",
        "propout": "payload",
        "object": "msg",
        "objectout": "msg",
        "close": false,
        "show": true,
        "ssl": true,
        "outputs": 1,
        "x": 410,
        "y": 100,
        "wires": [
            []
        ]
    },
    {
        "id": "27100f4dbdee757d",
        "type": "inject",
        "z": "129d963431e3975c",
        "name": "https://flows.nodered.org/",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "https://flows.nodered.org/",
        "payloadType": "str",
        "x": 170,
        "y": 100,
        "wires": [
            [
                "a1c3b5dc9d7fc22e"
            ]
        ]
    }
]

```

But the file is not created. I forgot something ?  
An idea ?

---

<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: [26 January 2022 21:18 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/2 "2022-01-26T21:18:58Z")

</div>

Hi, in order to make code more readable and importable it is important to surround your code with three backticks

````auto
```
 like this
```

````

You can edit and correct your post by clicking the pencil icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

### Author: ![Lafayette](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@Lafayette](https://discourse.nodered.org/u/Lafayette)
#### Post date: [26 January 2022 21:35 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/3 "2022-01-26T21:35:18Z")

</div>

Done thx !

---

<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: [26 January 2022 21:49 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/4 "2022-01-26T21:49:19Z")

</div>

> [@Lafayette](#):
>
> Hi i use this flow to save a web page into a pdf file

> [@Lafayette](#):
>
> But the file is not created. I forgot something ?

Well since your flow is only 2 nodes an inject and an nBrowser node - you are not doing anything with the result so you wont save anything.

---

<div class="post-metadata">

### Author: ![Lafayette](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@Lafayette](https://discourse.nodered.org/u/Lafayette)
#### Post date: [26 January 2022 23:16 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/5 "2022-01-26T23:16:37Z")

</div>

> [@Steve-Mcl](#):
>
> Well since your flow is only 2 nodes an inject and an nBrowser node - you are not doing anything with the result so you wont save anything.

I'm surprised because i thought that nbrowser was supposed to do the job :

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

My debug node show me nothing and the debug window remains empty after the injection.

---

<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: [26 January 2022 23:28 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/6 "2022-01-26T23:28:29Z")

</div>

My apologies, I have not used that node - I wrongly assumed it would output something from the output pin - for you to save.

Does it work if you select other save as type?

Does the path `/data/pdf/` exist & can you access it (is this a docker node-red? and if so, do you know how to access `/data/pdf/` to check if the file is written?)

Are there any errors in node-red terminal / log?

---

<div class="post-metadata">

### Author: ![Lafayette](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@Lafayette](https://discourse.nodered.org/u/Lafayette)
#### Post date: [26 January 2022 23:30 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/7 "2022-01-26T23:30:44Z")

</div>

Yes the path exist, i have all rights (RW) and i can access to this folder, node red (the docker) too. I have no error message. It's strange.

---

<div class="post-metadata">

### Author: ![Lafayette](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@Lafayette](https://discourse.nodered.org/u/Lafayette)
#### Post date: [27 January 2022 15:32 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/8 "2022-01-27T15:32:01Z")

</div>

I found an error in the.npm/logs folder :  
27 Jan 15:33:41 - [red] Uncaught Exception:  
27 Jan 15:33:41 - [error] Error: spawn /data/node\_modules/electron/dist/electron ENOENT  
at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:274:19)  
at onErrorNT (internal/child\_process.js:469:16)  
at processTicksAndRejections (internal/process/task\_queues.js:82:21)  
npm ERR! code ELIFECYCLE  
npm ERR! errno 1  
npm ERR! node-red-docker@2.1.6 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the node-red-docker@2.1.6 start script.  
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.  
npm ERR! A complete log of this run can be found in:  
npm ERR! /data/.npm/\_logs/2022-01-27T15\_33\_41\_042Z-debug.log

> node-red-docker@2.1.6 start /usr/src/node-red  
> node $NODE\_OPTIONS node\_modules/node-red/red.js $FLOWS "--userDir" "/data"

But i don't understand the problem.

---

<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: [27 January 2022 15:46 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/9 "2022-01-27T15:46:13Z")

</div>

how have you installed node-red?

Is node-red installed in docker or directly?

What hardware and OS is this running on?

Are you running an electron version of node-red?

---

<div class="post-metadata">

### Author: ![Lafayette](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@Lafayette](https://discourse.nodered.org/u/Lafayette)
#### Post date: [27 January 2022 16:00 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/10 "2022-01-27T16:00:58Z")

</div>

Hi,  
It's a docker with a data folder with all rights (RW)  
I use Portainer in my Qnap NAS to install the docker but I access to node red with a mac  
I guess I don't run an electron version (how can i know that ? )  
Thx

---

<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: [27 January 2022 16:25 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/11 "2022-01-27T16:25:18Z")

</div>

> [@Lafayette](#):
>
> I guess I don't run an electron version (how can i know that ? )

I only asked as i seen this...

> [@Lafayette](#):
>
> [error] Error: spawn /data/node\_modules/electron/dist/electron ENOENT  
> at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:274:19)  
> at onErrorNT (internal/child\_process.js:469:16)

* * *

Do you have a standard installation of node-red (like on your MAC or a raspberry pi) that you can try this - to rule out the usual docker issues?

---

<div class="post-metadata">

### Author: ![Lafayette](https://avatars.discourse-cdn.com/v4/letter/l/47e85d/32.png) [@Lafayette](https://discourse.nodered.org/u/Lafayette)
#### Post date: [27 January 2022 20:44 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/12 "2022-01-27T20:44:42Z")

</div>

I think i'm going to try to find another node to do the job. I don't know if it exists.

---

<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: [28 March 2022 20:45 UTC](https://discourse.nodered.org/t/nbrower-node-saveas-doesnt-work/57283/13 "2022-03-28T20:45:17Z")

</div>

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