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
- npm install -g --unsafe-perm node-red
- bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/rpm/update-nodejs-and-nodered)
-
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