CentOS7 install of Node-Red fails to launch

Hi all,
Been using node-red for awhile on Windows but now trying to install it on Linux and facing an issue.

Linux version: CentOS Linux release 7.5.1804
Node version: v6.17.1
NPM version: 3.10.10
Node-red version: latest (but also tried node-red@2.0.1 because that is what is working on my Windows box)
What happens:

  • Do a fresh install of node-red on the Linux box. Tried both ways of installing below and come to the same result

  • Tried the following:

    • Completely uninstall all the node red elements (including the node-red-* stuff under /usr/bin and the node-red node module folder under /usr/lib. I do note that it seems like npm uninstall has no effect (node-red still returns the error at the bottom even after uninstall) so I have to go manually and remove the node-red node modules folder.
    • After uninstall do a new install with both default node-red and older version, using both install approaches above, and no change in outcome. I see the error just below when I run npm install. In other regards the install output seems normal (but I can paste it in here if someone thinks it might be useful):
> node-pre-gyp ERR! UNCAUGHT EXCEPTION
> node-pre-gyp ERR! stack /usr/lib/node_modules/node-red/node_modules/make-dir/index.js:31
> node-pre-gyp ERR! stack                 ...defaults,
> node-pre-gyp ERR! stack                 ^^^
> node-pre-gyp ERR! stack
> node-pre-gyp ERR! stack SyntaxError: Unexpected token ...
> node-pre-gyp ERR! stack     at createScript (vm.js:56:10)
> node-pre-gyp ERR! stack     at Object.runInThisContext (vm.js:97:10)
> node-pre-gyp ERR! stack     at Module._compile (module.js:549:28)
> node-pre-gyp ERR! stack     at Object.Module._extensions..js (module.js:586:10)
> node-pre-gyp ERR! stack     at Module.load (module.js:494:32)
> node-pre-gyp ERR! stack     at tryModuleLoad (module.js:453:12)
> node-pre-gyp ERR! stack     at Function.Module._load (module.js:445:3)
> node-pre-gyp ERR! stack     at Module.require (module.js:504:17)
> node-pre-gyp ERR! stack     at require (internal/module.js:20:19)
> node-pre-gyp ERR! stack     at Object.<anonymous> (/usr/lib/node_modules/node-red/node_modules/@mapbox/node-pre-gyp/lib/install.js:13:17)

Another weird thing after install is that node-red does not show up in the list of npm modules (npm list). Shouldn't it?
- I tried all the above installs both as root and logged in user, neither seemed to make a difference in the failure modes here.

The error I get when I try to run node-red at the command line after any of the installs above is the below:

> [root@mybox lib]# node-red
> /usr/lib/node_modules/node-red/node_modules/fs-extra/lib/index.js:5
>   ...require('./fs'),
>   ^^^
> 
> SyntaxError: Unexpected token ...
>     at createScript (vm.js:56:10)
>     at Object.runInThisContext (vm.js:97:10)
>     at Module._compile (module.js:549:28)
>     at Object.Module._extensions..js (module.js:586:10)
>     at Module.load (module.js:494:32)
>     at tryModuleLoad (module.js:453:12)
>     at Function.Module._load (module.js:445:3)
>     at Module.require (module.js:504:17)
>     at require (internal/module.js:20:19)
>     at Object.<anonymous> (/usr/lib/node_modules/node-red/red.js:38:10)
> ````

Has anyone seen this before and know what I can do to get around it to successful install? Thanks for any feedback!

Mitch

I do not think there are many Centos users on here so not sure how much help you will get.

I have Centos 8 running on my main server but do not run NR on it so can not really help there.

I would suggest one of a couple of things

  1. Run it under Docker on Centos
  2. Upgrade to Centos 8
  3. Set a Virtual machine environment on Centos are run it in there on Debian or Ubuntu

Craig

You need nodejs at least V12.x

2 Likes

Hi all,

@craigcurtin unfortunately I have no control over the OS version or flavor, and due to server compute capabilities, running docker or another VM just isn't feasible....

@Colin that was the issue! I don't know why, maybe because it is an older Centos version, but the upgrade path on that system stopped at v6. When I downloaded the binaries and installed manually, it went to v14, and the problem disappeared. Thanks for your help!

Mitch

1 Like

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