Installation issues

I can’t install n8n, install via the npm install n8n -g command.

sudo npm install n8n -g
npm WARN deprecated [email protected]: request has been deprecated, see Issues · request/request · GitHub
/3142
npm WARN deprecated [email protected]: This version of pg-promise is obsolete. You should update to a newer ver
sion.
/usr/bin/n8n → /usr/lib/node_modules/n8n/bin/n8n

[email protected] install /usr/lib/node_modules/n8n/node_modules/sqlite3
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v83 ABI, glibc) (
falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir ‘/usr/lib/node_modules/n8n/node_modules/sqlite3/l
ib/binding’
gyp WARN EACCES current user (“nobody”) does not have permission to access the dev dir “/root/.cache/node-gyp/
14.5.0”
gyp WARN EACCES attempting to reinstall using temporary dev dir “/usr/lib/node_modules/n8n/node_modules/sqlite
3/.node-gyp”
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/usr/lib/node_modules/n8n/node_modules/sqlite3/.node-g
yp’
gyp ERR! System Linux 5.7.7-arch1-1
gyp ERR! command “/usr/bin/node” “/usr/lib/node_modules/node-gyp/bin/node-gyp.js” “configure” “–fallback-to-b
uild” “–module=/usr/lib/node_modules/n8n/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.nod
e” “–module_name=node_sqlite3” “–module_path=/usr/lib/node_modules/n8n/node_modules/sqlite3/lib/binding/node
-v83-linux-x64” “–napi_version=6” “–node_abi_napi=napi” “–napi_build_version=0” "–node_napi_label=node-v83
"
gyp ERR! cwd /usr/lib/node_modules/n8n/node_modules/sqlite3
gyp ERR! node -v v14.5.0
gyp ERR! node-gyp -v v7.0.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js
configure --fallback-to-build --module=/usr/lib/node_modules/n8n/node_modules/sqlite3/lib/binding/node-v83-li
nux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/n8n/node_modules/sqli
te3/lib/binding/node-v83-linux-x64 --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_la
bel=node-v83’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/lib/node_modules/n8n/node_modules/node-pre-gyp/l
ib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1051:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Linux 5.7.7-arch1-1
node-pre-gyp ERR! command “/usr/bin/node” “/usr/lib/node_modules/n8n/node_modules/.bin/node-pre-gyp” “install”
“–fallback-to-build”
node-pre-gyp ERR! cwd /usr/lib/node_modules/n8n/node_modules/sqlite3
node-pre-gyp ERR! node -v v14.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build
–module=/usr/lib/node_modules/n8n/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node --mod
ule_name=node_sqlite3 --module_path=/usr/lib/node_modules/n8n/node_modules/sqlite3/lib/binding/node-v83-linux-
x64 --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83’ (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
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! /root/.npm/_logs/2020-07-13T18_03_58_217Z-debug.log

This seems to be probably one of the main things going wrong:

gyp WARN EACCES current user (“nobody”) does not have permission to access the dev dir “/root/.cache/node-gyp/

Maybe this helps you:
https://github.com/nodejs/node-gyp/issues/1236