Problem installing n8n on centos 7

Good day everyone. I’m new to N8N. It really looks an amazing software to use with software I already use (Mautic, Invoice Ninja, …) and I really want to learn what I can do with it. To start with it, I wanted to deploy it. But here something already goes wrong…

Describe the issue/error/question

So during installation with NPM I have following error code showing up:

This is directly from the log:
6789 verbose cwd /root
6790 verbose Linux 3.10.0-1160.59.1.el7.x86_64
6791 verbose node v17.8.0
6792 verbose npm v8.6.0
6793 error code 127
6794 error path /root/.nvm/versions/node/v17.8.0/lib/node_modules/n8n/node_modu$
6795 error command failed
6796 error command sh -c node-pre-gyp install --fallback-to-build
6797 error sh: node-pre-gyp: command not found
6798 verbose exit 127
6799 timing npm Completed in 308695ms

Current OS: Centos 7 with directadmin and custombuilt 2 working.
I use putty to use an SSH shell with Root user rights.
I used following commands:
npm install n8n -g

I tried following commands too:
sudo npm install --unsafe-perm=true --allow-root
I also installed the node-pre-gyp with a separate command, but it doesn’t seem to be the solution.

Last point I wanted to tell is that I used google before posting this but unfortunately I couldn’t really find any useful information.

Thank you all for your time to read this and think with me on how to resolve the issue.
PS. If you need more info, don’t hesitate to give a shout.

Kind regards
Thank you for the help.

What command did you use to install node-pre-gyp

1 Like

Welcome to the community @jarnstev !

I wonder if it has anything to do with you using Node.js v17. The officially supported version right now is v16.

Hello Rowan.

I used:
npm install node-pre-gyp -g

It confirmed me afterwards that the installation was succesfull.

Hi Jan! Thank you for creating such a wonderful product!

I will take a look and try to downgrade node.js to v16. I’ll get back to you as soon as I have more information.

Thanks for you help!

Hi @jan.

I downgraded Node.js to v16.14.2. Unfortunately still the same problem:

Part of the log is below:

4815 info run [email protected] install { code: 127, signal: null }
4816 info run [email protected] install { code: 1, signal: null }
4817 info run [email protected] install { code: 1, signal: null }
4818 verbose reify failed optional dependency /root/.nvm/versions/node/v16.14.2$
4819 silly reify mark deleted [
4819 silly reify   '/root/.nvm/versions/node/v16.14.2/lib/node_modules/n8n/node$
4819 silly reify ]
4820 verbose reify failed optional dependency /root/.nvm/versions/node/v16.14.2$
4821 silly reify mark deleted [
4821 silly reify   '/root/.nvm/versions/node/v16.14.2/lib/node_modules/n8n/node$
4821 silly reify ]
4822 verbose reify failed optional dependency /root/.nvm/versions/node/v16.14.2$
4823 silly reify mark deleted [
4823 silly reify   '/root/.nvm/versions/node/v16.14.2/lib/node_modules/n8n/node$
4823 silly reify ]
4824 timing build:run:install:node_modules/n8n/node_modules/cpu-features Comple$
4825 timing reify:rollback:createSparse Completed in 63086ms
4826 timing reify:rollback:retireShallow Completed in 0ms
4827 timing command:install Completed in 301558ms
4828 verbose stack     at ChildProcess.<anonymous> (/root/.nvm/versions/node/v1$
4828 verbose stack     at ChildProcess.emit (node:events:526:28)
4828 verbose stack     at maybeClose (node:internal/child_process:1092:16)
4828 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/ch$
4829 verbose pkgid [email protected]
4830 verbose cwd /root
4831 verbose Linux 3.10.0-1160.59.1.el7.x86_64
4832 verbose argv "/root/.nvm/versions/node/v16.14.2/bin/node" "/root/.nvm/vers$
4833 verbose node v16.14.2
4834 verbose npm  v8.5.0
4835 error code 127
4836 error path /root/.nvm/versions/node/v16.14.2/lib/node_modules/n8n/node_mod$
4837 error command failed
4838 error command sh -c node-pre-gyp install --fallback-to-build
4839 error sh: node-pre-gyp: command not found
4840 verbose exit 127
4841 timing npm Completed in 301804ms
4842 verbose unfinished npm timer reify 1649611074151
4843 verbose unfinished npm timer reify:build 1649611303467
4844 verbose unfinished npm timer build 1649611303471
4845 verbose unfinished npm timer build:deps 1649611303471
4846 verbose unfinished npm timer build:run:install 1649611303934
4847 verbose unfinished npm timer build:run:install:node_modules/n8n/node_modul$
4848 verbose unfinished npm timer build:run:install:node_modules/n8n/node_modul$
4849 verbose code 127

Thank you for the help.

Kind regards

Hey @jarnstev,

Could you save the full output? The copy / paste seems to be cutting off the lines.

Hello Jon

Thanks for your help.

You can find the log file here

Thanks for the help


Thanks @jarnstev,

Looking at the log it still seems like the OS is saying the command can’t be found. As a quick experiment I just set up a Digital Ocean droplet usign Cent 7 and I hit the same issue. It looks like it is failing to install sqlite3 and even an npm install -g sqlite3 results in the same error

I did find that installing without -g for just the sqlite3 package works, I have gone down an SELinux route as that has caused me issues with applications in the past but I had no luck with that either.

At this point I think it might be easier to just make a new user and see if that works :slight_smile: I will continue to dig into this tomorrow to see if I can work anything out.

Hello Guys

Thanks for the help.

I’m currently using N8N on Ubuntu. Since I’ll be migrating the rest of my applications to ubuntu in the future, you can close the ticket.