I’m running into an issue when I am attempting to install n8n. Just for reference, I’m running this on a digital ocean droplet, Ubuntu 20.04 (LTS) x64.
Here is the portion showing the installation process:
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# npm i -g n8n
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/usr/local/bin/n8n -> /usr/local/lib/node_modules/n8n/bin/n8n
> sqlite3@4.2.0 install /usr/local/lib/node_modules/n8n/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
It seems to be successful, but then whenever I try and run the n8n or n8n start command, I get the following error:
root@ubuntu-s-1vcpu-1gb-nyc1-01:~# n8n
(node:211605) UnhandledPromiseRejectionWarning: DriverPackageNotInstalledError: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save
at new DriverPackageNotInstalledError (/usr/local/lib/node_modules/n8n/node_modules/typeorm/error/DriverPackageNotInstalledError.js:10:28)
at SqliteDriver.loadDependencies (/usr/local/lib/node_modules/n8n/node_modules/typeorm/driver/sqlite/SqliteDriver.js:127:19)
at new SqliteDriver (/usr/local/lib/node_modules/n8n/node_modules/typeorm/driver/sqlite/SqliteDriver.js:28:15)
at DriverFactory.create (/usr/local/lib/node_modules/n8n/node_modules/typeorm/driver/DriverFactory.js:43:24)
at new Connection (/usr/local/lib/node_modules/n8n/node_modules/typeorm/connection/Connection.js:53:59)
at ConnectionManager.create (/usr/local/lib/node_modules/n8n/node_modules/typeorm/connection/ConnectionManager.js:56:26)
at Object.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/typeorm/index.js:194:66)
at step (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:141:27)
at Object.next (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:122:57)
at /usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:115:75
(node:211605) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:211605) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:211605) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
(node:211605) UnhandledPromiseRejectionWarning: Error: There was an error: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save
at Object.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/errors/lib/index.js:26:15)
at Start.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/command/lib/command.js:60:23)
at /usr/local/lib/node_modules/n8n/dist/commands/start.js:126:22
(node:211605) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
From my googling, it seems to be something to do with electron, but I’m not 100% sure. Any advice or feedback you have around this would be greatly appreciated. If there’s any more information I can give to help, just let me know and I’ll get it to you ASAP. Thank you!
Sorry to hear that you have problems! Can not be an electron problem as we are not using it. Guess really something is going wrong when n8n gets installed. What you could try is to first run the following:
apt-get install -y build-essential python
and then try to install n8n again. Maybe that helps.
Here is what I ran along with the output. I actually did try this same command earlier but didn’t have any luck.
root@ubuntu-s-1vcpu-1gb-nyc1-01:~/n8n# apt-get install -y build-essential python
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'python-is-python2' instead of 'python'
build-essential is already the newest version (12.8ubuntu1).
python-is-python2 is already the newest version (2.7.17-4).
0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded.
And then I still seem to be getting the same error:
root@ubuntu-s-1vcpu-1gb-nyc1-01:~/n8n# n8n
(node:212344) UnhandledPromiseRejectionWarning: DriverPackageNotInstalledError: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save
at new DriverPackageNotInstalledError (/usr/local/lib/node_modules/n8n/node_modules/typeorm/error/DriverPackageNotInstalledError.js:10:28)
at SqliteDriver.loadDependencies (/usr/local/lib/node_modules/n8n/node_modules/typeorm/driver/sqlite/SqliteDriver.js:127:19)
at new SqliteDriver (/usr/local/lib/node_modules/n8n/node_modules/typeorm/driver/sqlite/SqliteDriver.js:28:15)
at DriverFactory.create (/usr/local/lib/node_modules/n8n/node_modules/typeorm/driver/DriverFactory.js:43:24)
at new Connection (/usr/local/lib/node_modules/n8n/node_modules/typeorm/connection/Connection.js:53:59)
at ConnectionManager.create (/usr/local/lib/node_modules/n8n/node_modules/typeorm/connection/ConnectionManager.js:56:26)
at Object.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/typeorm/index.js:194:66)
at step (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:141:27)
at Object.next (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:122:57)
at /usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:115:75
(node:212344) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:212344) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:212344) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
(node:212344) UnhandledPromiseRejectionWarning: Error: There was an error: SQLite package has not been found installed. Try to install it: npm install sqlite3 --save
at Object.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/errors/lib/index.js:26:15)
at Start.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/command/lib/command.js:60:23)
at /usr/local/lib/node_modules/n8n/dist/commands/start.js:126:22
(node:212344) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
Here is the error I get when I try to run npm run build inside of that repo:
root@ubuntu-s-1vcpu-1gb-nyc1-01:~/n8n# npm run build
> n8n@ build /root/n8n
> lerna exec npm run build
info cli using local version of lerna
lerna notice cli v3.22.1
lerna info versioning independent
lerna info Executing command in 6 packages: "npm run build"
> n8n-node-dev@0.10.0 build /root/n8n/packages/node-dev
> tsc
> n8n-workflow@0.42.0 build /root/n8n/packages/workflow
> tsc
> n8n-core@0.47.0 build /root/n8n/packages/core
> tsc
> n8n-editor-ui@0.59.0 build /root/n8n/packages/editor-ui
> cross-env VUE_APP_PUBLIC_PATH="/%BASE_PATH%/" vue-cli-service build
⠙ Building for production...Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
⠦ Building for production...npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! n8n-editor-ui@0.59.0 build: `cross-env VUE_APP_PUBLIC_PATH="/%BASE_PATH%/" vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the n8n-editor-ui@0.59.0 build 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-10-10T19_37_11_339Z-debug.log
lerna ERR! npm run build exited 1 in 'n8n-editor-ui'
lerna ERR! npm run build exited 1 in 'n8n-editor-ui'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! n8n@ build: `lerna exec npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the n8n@ build 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-10-10T19_37_11_400Z-debug.log
I hope that helps some. If there’s anything else I can provide to help track down the issue then let me know!
Here is the contents of the error log that this error references as well:
root@ubuntu-s-1vcpu-1gb-nyc1-01:~/n8n# cat /root/.npm/_logs/2020-10-10T19_37_11_339Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm@6.14.4
3 info using node@v10.19.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle n8n-editor-ui@0.59.0~prebuild: n8n-editor-ui@0.59.0
6 info lifecycle n8n-editor-ui@0.59.0~build: n8n-editor-ui@0.59.0
7 verbose lifecycle n8n-editor-ui@0.59.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle n8n-editor-ui@0.59.0~build: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/root/n8n/packages/editor-ui/node_modules/.bin:/root/n8n/packages/editor-ui/node_modules/.bin:/root/n8n/packages/node_modules/.bin:/root/n8n/node_modules/.bin:/root/node_modules/.bin:/node_modules/.bin:/usr/bin:/usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/root/n8n/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle n8n-editor-ui@0.59.0~build: CWD: /root/n8n/packages/editor-ui
10 silly lifecycle n8n-editor-ui@0.59.0~build: Args: [ '-c',
10 silly lifecycle 'cross-env VUE_APP_PUBLIC_PATH="/%BASE_PATH%/" vue-cli-service build' ]
11 silly lifecycle n8n-editor-ui@0.59.0~build: Returned: code: 1 signal: null
12 info lifecycle n8n-editor-ui@0.59.0~build: Failed to exec build script
13 verbose stack Error: n8n-editor-ui@0.59.0 build: `cross-env VUE_APP_PUBLIC_PATH="/%BASE_PATH%/" vue-cli-service build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid n8n-editor-ui@0.59.0
15 verbose cwd /root/n8n/packages/editor-ui
16 verbose Linux 5.4.0-45-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v10.19.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error n8n-editor-ui@0.59.0 build: `cross-env VUE_APP_PUBLIC_PATH="/%BASE_PATH%/" vue-cli-service build`
22 error Exit status 1
23 error Failed at the n8n-editor-ui@0.59.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Did you see this guide? That describes step by step who to install n8n on a new server.
Because if you want to run n8n properly you should really follow that one. Only then does it set up everything properly and uses SSL so that you can use Trigger-Nodes from external services. If you just npm install n8n it will be fine for just spinning it up to play around a little bit but really nothing more.
Gotcha, so docker is kinda required to get the fullest out of n8n? I didn’t realize that was a requirement just from looking at the documentation. Thank you for the extra information! I will give that a shot and report back with my progress.
Ah no, is not a requirement at all. It only makes it much simpler.
It sets up directly a reverse proxy, SSL, and so on. Also makes it very simple to upgrade to the latest version and avoids problems like you are facing as the docker image contains everything that is needed to run n8n with the supported versions.
I can see it being simpler if you want to setup the entire n8n suite, but I just wanted to play around with it a little on my off time so a simple npm i -g n8n and n8n seemed simpler to me for just playing around. Nevertheless, I appreciate your help a great deal!
I was able to get it running with docker and an old domain I had laying around. It’s a testament to the quality of what you’ve built that I was able to get it up and running so quickly, so thank you!
Just in case somebody else has the same problem. Created now a new Digital Ocean droplet with Ubuntu 20.04 and could get n8n up and running like this:
cd ~
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
sudo apt install nodejs -y
npm i -g n8n --unsafe
n8n
But just to say it again. Is not recommended. Should be installed with a different user, security should get activated, SSL, … . So still advise strongly to use the Server Setup Guide from above.