Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support apt installed versions of node-red #8

Closed
shanness opened this issue Jan 3, 2019 · 17 comments
Closed

Doesn't support apt installed versions of node-red #8

shanness opened this issue Jan 3, 2019 · 17 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@shanness
Copy link

shanness commented Jan 3, 2019

I suspect this is because most of my NR modules are in /usr/lib? (Because I used apt to install it).
Here is the error I get.

{ Error: Cannot find module '../../../../../../../../home/craig/.node-red/node_modules/node-red-dashboard'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.requireModule [as require] (/usr/lib/node_modules/node-red/red/runtime/nodes/registry/loader.js:69:16)
    at new LEDNode (/home/craig/.node-red/node_modules/node-red-contrib-ui-led/led.js:35:26)
    at createNode (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:305:18)
    at Flow.start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:89:35)
    at start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:328:29)
    at /usr/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:164:25 code: 'MODULE_NOT_FOUND' }
@yoiang
Copy link
Member

yoiang commented Jan 4, 2019

Hmm, I'll have a look through and see if the module is doing anything unusual with its includes or dependencies. node-red-dashboard is a requirement of the module and it shouldn't have any hard declaration to look for the module in a specific relative folder.

@yoiang yoiang added bug Something isn't working help wanted Extra attention is needed labels Jan 5, 2019
@yoiang
Copy link
Member

yoiang commented Jan 13, 2019

Hey @shanness, I haven't had a chance to reproduce the situation, any change or luck figuring this out?

@shanness
Copy link
Author

Hey @yoiang, I don't really know nodejs or node-reds internals, but do have this in

craig@home:~/.node-red$ ls /home/craig/.node-red/node_modules/node-red-dashboard
CHANGELOG.md  Charts.md  config-fields.md  CONTRIBUTING.md  dist  fixfa.js  ISSUE_TEMPLATE.md  LICENSE  license.js  nodes  package.json  README.md  ui.js

And this in ~/.node-red/.config

  "node-red-dashboard": {
   "name": "node-red-dashboard",
   "version": "2.9.8",
   "local": true,
   "nodes": {
    "ui_base": {
     "name": "ui_base",
     "types": [
      "ui_base"
     ],
     "enabled": true,
     "local": true,
     "module": "node-red-dashboard",
     "file": "/home/craig/.node-red/node_modules/node-red-dashboard/nodes/ui_base.js"

The problem seems to be the resolver adding all the ../.. stuff at the start?

{ Error: Cannot find module '../../../../../../../../home/craig/.node-red/node_modules/node-red-dashboard'

As /home/craig/.node-red/node_modules/node-red-dashboard/ exists.

If I go into the dir for the file reporting the error above (/usr/lib/node_modules/node-red/red/runtime/nodes/registry/loader.js), then this works.

craig@home:/usr/lib/node_modules/node-red/red/runtime/nodes/registry$ ls ../../../../../../../../home/craig/.node-red/node_modules/node-red-dashboard
CHANGELOG.md  Charts.md  config-fields.md  CONTRIBUTING.md  dist  fixfa.js  ISSUE_TEMPLATE.md  LICENSE  license.js  nodes  package.json  README.md  ui.js

Does that help at all?

@yoiang
Copy link
Member

yoiang commented Jan 22, 2019

Is there an entry in the .node-red/.config file for node-red-contrib-ui-led? What does that look like?

@shanness
Copy link
Author

  "node-red-contrib-ui-led": {
   "name": "node-red-contrib-ui-led",
   "version": "0.1.1",
   "local": true,
   "nodes": {
    "led": {
     "name": "led",
     "types": [
      "led"
     ],
     "enabled": true,
     "local": true,
     "module": "node-red-contrib-ui-led",
     "file": "/home/craig/.node-red/node_modules/node-red-contrib-ui-led/led.js"
    }
   }
  },

@liz-miller
Copy link

I'm having this exact issue too. Does anyone have the fix?

@yoiang
Copy link
Member

yoiang commented May 9, 2019

Folks in #30 who also installed via apt-install say that updating to the latest version of ui_led (0.2.3) and rebooting fixed it for them. I'm not sure why yet but give it a go!

@shanness
Copy link
Author

Hey @yoiang , Nah, sorry, didn't fix it. And if anyone is going to try, delete any LED nodes first! I had to manually hack them out of my flows_home.json (couldn't restart after upgrade without removing the existing test LED node.

Still getting this

13 May 23:58:46 - [error] [ui_list:605ba0ac.13ed6] TypeError: Cannot read property 'push' of undefined
While constructing LEDNode widget: { Error: Cannot find module '../../../../../../../../home/craig/.node-red/node_modules/node-red-dashboard'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.requireModule [as require] (/usr/lib/node_modules/node-red/red/runtime/nodes/registry/loader.js:69:16)
    at new LEDNode (/home/craig/.node-red/node_modules/node-red-contrib-ui-led/led.js:13:26)
    at createNode (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:305:18)
    at Flow.start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:89:35)
    at start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:328:29)
    at /usr/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:164:25 code: 'MODULE_NOT_FOUND' }

@yoiang
Copy link
Member

yoiang commented May 13, 2019

Are you comfortable enough to be able to test a branch without changing anything else? I just pushed https://github.com/Adorkable/node-red-contrib-ui-led/tree/feature/issue8 with a little change to match other libraries scoping of some variables, and may have another idea if that doesn't help.

@shanness
Copy link
Author

shanness commented May 14, 2019

Hey @yoiang ,
I removed the existing UI installed version, and ran this
craig@home:~/.node-red$ npm install https://github.com/Adorkable/node-red-contrib-ui-led.git#feature/issue8
I restarted NR, then added the LED node to my flow and redeployed, and got the same issue.

Is that the right way to test it?

@yoiang
Copy link
Member

yoiang commented May 15, 2019

Yes, I think that should have installed it properly, dang. You haven't run into this issue at all with any other Node-RED UI nodes either?

Have you raised this in the Node-RED dashboard github? They might know exactly what's going on, I'm at a loss. At some point I'm going to have to recreate your installation, in a container I think.

@shanness
Copy link
Author

Hey,

Got the same problem with this other dashbord plugin, and just checked, pretty sure they are the only two UI/dashboard plugins I'm using.

node-red-hitachi/ui_list#7

Haven't rasied in on the dashboard github yet. Are there any other UI plugins you'd suggest I try? Happy to help find one that works?

@yoiang
Copy link
Member

yoiang commented May 20, 2019

You can check here for more contrib-ui, however it's sounding more and more like an issue with node-red-dashboard or with node-red!

@shanness
Copy link
Author

Ta, just confirmed getting the same issue with ui-level. And others have reported it too.

hotNipi/node-red-contrib-ui-level#7

I'll move up the line, and perhaps check on discord as the above issue suggests. If I find a solution, I'll update all 3 tickets.

Thanks for your help.

@yoiang
Copy link
Member

yoiang commented Jul 9, 2019

Hey @shanness, any luck on this front? Or can you paste the thread following this issue so others can follow along?

@shanness
Copy link
Author

Hey @yoiang, I haven't had time to do anything about this, and unlikely will any time soon, just too busy with other projects and this isn't pressing enough to chase ATM. Sorry about that.

@yoiang
Copy link
Member

yoiang commented Jul 12, 2019

No worries! I'm going to close the issue now that it's most likely a Node-RED/Node-RED Dashboard issue. If you do follow up feel free to post the link here.

@yoiang yoiang closed this as completed Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants