N8n on cpanel

Hi dear @jan

I have Cpanel shared host
It has features that I can create node.js webapplications.

I try to install n8n on it via its virtual environment (like SSH) but it show below error.
Could you please help me?

Best regards;

/home/.../nodevenv/.../.../lib/bin/n8n -> /home/.../nodevenv/.../.../lib/lib/node_modules/n8n/bin/n8n
npm WARN lifecycle The node binary used for scripts is /home/.../nodevenv/.../.../bin/node but npm is using /opt/alt/alt-nodejs10/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] install /home/.../nodevenv/.../.../lib/lib/node_modules/n8n/node_modules/mmmagic
> node-gyp rebuild

 make: Entering directory `/home/.../nodevenv/.../.../lib/lib/node_modules/n8n/node_modules/mmmagic/build'
  CC(target) Release/obj.target/libmagic/deps/libmagic/src/apprentice.o
make: execvp: cc: Permission denied
make: *** [Release/obj.target/libmagic/deps/libmagic/src/apprentice.o] Error 127
make: Leaving directory `/home/.../nodevenv/.../.../lib/lib/node_modules/n8n/node_modules/mmmagic/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/build.js:193:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 2.6.32-954.3.5.lve1.4.63.el6.x86_64
gyp ERR! command "/opt/alt/alt-nodejs10/root/usr/bin/node" "/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/.../nodevenv/.../.../lib/lib/node_modules/n8n/node_modules/mmmagic
gyp ERR! node -v v10.17.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/...

Sorry no experience with cpanel and how they set up the environment and how Node.js runs in it.

The first line however:

/home/.../nodevenv/.../.../lib/bin/n8n -> /home/.../nodevenv/.../.../lib/lib/node_modules/n8n/bin/n8n
npm WARN lifecycle The node binary used for scripts is /home/.../nodevenv/.../.../bin/node but npm is using /opt/alt/alt-nodejs10/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

Sounds like there is probably something wrong.

So maybe something like that:

Hey mooghermez,
Plesk is kinda similar to cpanel. I created a doc on installing on Plesk, maybe it helps you:

3 Likes

Thank you my frind
I try to install n8n according to your doc but unfortunately I see below error:

npm WARN lifecycle The node binary used for scripts is /home/mydir/nodevenv/n8n.mysite.com/10/bin/node but npm is using /opt/alt/alt-nodejs10/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] install /home/mydir/nodevenv/n8n.mysite.com/10/lib/node_modules/mmmagic
> node-gyp rebuild

node[435392]: pthread_create: Resource temporarily unavailable
gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/configure.js:344:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
1 Like

It’s a very old version, too. Try nodejs v12

Hi, please look into this. I have tried to setup n8n on cPanel, but not able to do so due to this error. Or it will be great if you can share simple steps to follow for the same. The steps in the documentation do not work without error. Thanks

Have tried with Node 12.x too, but it does not work.

I had to install build essential on debian for mmmagic to work. Also check if --unsafe-perm flag (npm i -g n8n --unsafe-perm) works for you

1 Like