node-red-dashboard disappeared, will not reinstall

517 views
Skip to first unread message

timothylegg

unread,
Jan 10, 2018, 5:08:14 AM1/10/18
to Node-RED
Hello,

I traveled on vacation for two weeks.  I returned, and found one of my nodes labeled as 'unknown: ui_chart'.  That was when I found that node-red-dashboard wasn't installed as a module anymore.

I cannot install node-red-dashboard either.  I found this in the debug tab.

Error: Command failed: npm install --save --save-prefix="~" --production node-red-dashboard@2.7.0module.js:327 throw err;↵ ^↵↵Error: Cannot find module '/root/.node-red/node_modules/node-red-dashboard/fixfa.js' at Function.Module._resolveFilename (module.js:325:15)↵ at Function.Module._load (module.js:276:25)↵ at Function.Module.runMain (module.js:441:10)↵ at startup (node.js:139:18)↵ at node.js:990:3npm WARN node-red-project@0.0.1 No repository field.↵npm WARN node-red-project@0.0.1 No license field.↵npm ERR! Linux 4.10.0-42-genericnpm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "--save-prefix=\"~\"" "--production" "node-red-...@2.7.0"npm ERR! node v4.7.2npm ERR! npm v3.5.2npm ERR! code ELIFECYCLE↵↵npm ERR! node-red-dashboard@2.7.0 postinstall: `node fixfa.js`npm ERR! Exit status 1npm ERR! npm ERR! Failed at the node-red-dashboard@2.7.0 postinstall script 'node fixfa.js'.↵npm ERR! Make sure you have the latest version of node.js..."

This is a similar view from my console.

# node-red
10 Jan 10:02:52 - [info]

Welcome to Node-RED
===================

10 Jan 10:02:52 - [info] Node-RED version: v0.17.5
10 Jan 10:02:52 - [info] Node.js  version: v4.7.2
10 Jan 10:02:52 - [info] Linux 4.10.0-42-generic x64 LE
10 Jan 10:02:53 - [info] Loading palette nodes
10 Jan 10:03:01 - [warn] ------------------------------------------------------
10 Jan 10:03:01 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
10 Jan 10:03:01 - [warn] ------------------------------------------------------
10 Jan 10:03:01 - [info] Settings file  : /root/.node-red/settings.js
10 Jan 10:03:01 - [info] User directory : /root/.node-red
10 Jan 10:03:01 - [info] Flows file     : /root/.node-red/flows_curtis-ThinkPad-X220.json
10 Jan 10:03:01 - [info] Starting flows
10 Jan 10:03:02 - [info] Started flows
10 Jan 10:03:02 - [info] Server now running at http://127.0.0.1:1880/
10 Jan 10:30:48 - [info] Installing module: node-red-dashboard, version: 2.7.0
10 Jan 10:30:55 - [warn] Installation of module node-red-dashboard failed:
10 Jan 10:30:55 - [warn] ------------------------------------------
10 Jan 10:30:55 - [warn] Error: Command failed: npm install --save --save-prefix="~" --production node-red-dashboard@2.7.0
module.js:327
   
throw err;
   
^

Error: Cannot find module '/root/.node-red/node_modules/node-red-dashboard/fixfa.js'
    at
Function.Module._resolveFilename (module.js:325:15)
    at
Function.Module._load (module.js:276:25)
    at
Function.Module.runMain (module.js:441:10)
    at startup
(node.js:139:18)
    at node
.js:990:3
npm WARN node
-red-project@0.0.1 No repository field.
npm WARN node
-red-project@0.0.1 No license field.
npm ERR
! Linux 4.10.0-42-generic
npm ERR
! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "--save-prefix=\"~\"" "--production" "node-red-...@2.7.0"
npm ERR
! node v4.7.2
npm ERR
! npm  v3.5.2
npm ERR
! code ELIFECYCLE

npm ERR
! node-red-dashboard@2.7.0 postinstall: `node fixfa.js`
npm ERR
! Exit status 1
npm ERR
!
npm ERR
! Failed at the node-red-dashboard@2.7.0 postinstall script 'node fixfa.js'.
npm ERR
! Make sure you have the latest version of node.js and npm installed.
npm ERR
! If you do, this is most likely a problem with the node-red-dashboard package,
npm ERR
! not with npm itself.
npm ERR
! Tell the author that this fails on your system:
npm ERR
!     node fixfa.js
npm ERR
! You can get information on how to open an issue for this project with:
npm ERR
!     npm bugs node-red-dashboard
npm ERR
! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-red-dashboard
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/.node-red/npm-debug.log



I browsed this forum 20 days back and it seems I'm the only one that has had this happen.


There are two questions to address.

How did this happen?  My laptop was folded for two weeks.  I ran apt-get update this morning, but hadn't yet run apt-get upgrade, so I think that can be eliminated as a cause.  I have never ran out of resources (disk space, RAM) during this time interval.  Maybe there is a portion of node-red-dashboard that is downloaded remotely on demand that became broken on the new year perhaps...

How can I repair this?  I would rather not have to repair things with a delete-reinstall methodology unless there is no other option.  I would rather develop my skills by performing a repair. However, my skills in evaluating diagnostic data and error messages within JavaScript are limited.

timothylegg

unread,
Jan 10, 2018, 5:19:42 AM1/10/18
to Node-RED
I decided to use a search engine to find out more about fixfa.js.  What I saw was this November 8, 2017 posting:

https://github.com/node-red/node-red-dashboard/issues/304

I launched node-red as root today and it failed.

I launched node-red as a non-root user and it restored to functionality as I remember it having in December.

Apparently, there are issues running node-red as root.  What are other's thoughts?

Thanks,

Timothy D Legg

Colin Law

unread,
Jan 10, 2018, 5:31:18 AM1/10/18
to node...@googlegroups.com
Basically, don't run node-red as root. It is dangerous (as node-red
could overwrite anything on your system) and there is generally no
need. If you believe you need to run it as root then ask here and
usually there is an alternative.

Colin

On 10 January 2018 at 10:19, timothylegg <timoth...@gmail.com> wrote:
> I decided to use a search engine to find out more about fixfa.js. What I
> saw was this November 8, 2017 posting:
>
> https://github.com/node-red/node-red-dashboard/issues/304
>
> I launched node-red as root today and it failed.
>
> I launched node-red as a non-root user and it restored to functionality as I
> remember it having in December.
>
> Apparently, there are issues running node-red as root. What are other's
> thoughts?
>
> Thanks,
>
> Timothy D Legg
>
>
> On Wednesday, January 10, 2018 at 11:08:14 AM UTC+1, timothylegg wrote:
>>
>> Hello,
>>
>> I traveled on vacation for two weeks. I returned, and found one of my
>> nodes labeled as 'unknown: ui_chart'. That was when I found that
>> node-red-dashboard wasn't installed as a module anymore.
>>
>> I cannot install node-red-dashboard either. I found this in the debug
>> tab.
>>
>> Error: Command failed: npm install --save --save-prefix="~" --production
>> node-red-...@2.7.0↵module.js:327↵ throw err;↵ ^↵↵Error: Cannot find
>> module '/root/.node-red/node_modules/node-red-dashboard/fixfa.js'↵ at
>> Function.Module._resolveFilename (module.js:325:15)↵ at
>> Function.Module._load (module.js:276:25)↵ at Function.Module.runMain
>> (module.js:441:10)↵ at startup (node.js:139:18)↵ at node.js:990:3↵npm WARN
>> node-red...@0.0.1 No repository field.↵npm WARN node-red...@0.0.1
>> No license field.↵npm ERR! Linux 4.10.0-42-generic↵npm ERR! argv
>> "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "--save-prefix=\"~\""
>> "--production" "node-red-...@2.7.0"↵npm ERR! node v4.7.2↵npm ERR! npm
>> v3.5.2↵npm ERR! code ELIFECYCLE↵↵npm ERR! node-red-...@2.7.0
>> postinstall: `node fixfa.js`↵npm ERR! Exit status 1↵npm ERR! ↵npm ERR!
>> Failed at the node-red-...@2.7.0 postinstall script 'node
>> --save-prefix="~" --production node-red-...@2.7.0
>> module.js:327
>> throw err;
>> ^
>>
>> Error: Cannot find module
>> '/root/.node-red/node_modules/node-red-dashboard/fixfa.js'
>> at Function.Module._resolveFilename (module.js:325:15)
>> at Function.Module._load (module.js:276:25)
>> at Function.Module.runMain (module.js:441:10)
>> at startup (node.js:139:18)
>> at node.js:990:3
>> npm WARN node-red...@0.0.1 No repository field.
>> npm WARN node-red...@0.0.1 No license field.
>> npm ERR! Linux 4.10.0-42-generic
>> npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save"
>> "--save-prefix=\"~\"" "--production" "node-red-...@2.7.0"
>> npm ERR! node v4.7.2
>> npm ERR! npm v3.5.2
>> npm ERR! code ELIFECYCLE
>>
>> npm ERR! node-red-...@2.7.0 postinstall: `node fixfa.js`
>> npm ERR! Exit status 1
>> npm ERR!
>> npm ERR! Failed at the node-red-...@2.7.0 postinstall script 'node
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/18cb7224-9fa4-4fe4-9689-9cb90aeb9119%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Dave C-J

unread,
Jan 10, 2018, 6:15:59 AM1/10/18
to node...@googlegroups.com
Simplest explanation is that root and your normal user art two different users.
Each user has their own Node-RED user directory - normally ~/.node-red - so for user fred it would typically be   
  /home/fred/.node-red
and for root it would be
  /root/.node-red
if you then install extra nodes (eg the dashboard) as fred - they will be installed in fred's user directory.. so when you run as root it won't see those extra nodes... as it will be looking it's own (root's) user directory - and vice versa.

(plus the extra danger of running as root that Colin points out)

timothylegg

unread,
Jan 10, 2018, 10:49:02 AM1/10/18
to Node-RED
Yes, I discovered that experimentally after writing my prior reply.  I observed that the flows I had written before were present and the flow I had backed up in a text file would function again.

Not sure why the install of the node-red-dashboard failed, but if I can run the tool without root, I'll gladly do it.  I ran it as root on the suspicion that HTTP servers in general historically ran in an elevated status and therefore I should do that here too. 

Dave C-J

unread,
Jan 10, 2018, 11:22:27 AM1/10/18
to node...@googlegroups.com
By default Node-RED runs it's web server on port 1880... so is above the privileged range (1-1023) - so no need for root... - Of course if you move it down to port 80 then you may then need to start playing games with who's allowed to do what.

Julian Knight

unread,
Jan 11, 2018, 4:16:54 AM1/11/18
to Node-RED
As we are seeing so many permissions questions and issues, I've thrown together a page that pulls together what I think I know about the subject.


As always, comments and criticism welcome.
Reply all
Reply to author
Forward
0 new messages