diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 20987c08c0..d44ebbc2c5 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -1,4 +1,8 @@ import * as express from 'express'; +import { + dirname as pathDirname, + join as pathJoin, +} from 'path'; import * as bodyParser from 'body-parser'; import * as history from 'connect-history-api-fallback'; import * as requestPromise from 'request-promise-native'; @@ -1092,7 +1096,8 @@ class App { // Serve the website - this.app.use('/', express.static(__dirname + '/../../node_modules/n8n-editor-ui/dist', { index: 'index.html' })); + const editorUiPath = require.resolve('n8n-editor-ui'); + this.app.use('/', express.static(pathJoin(pathDirname(editorUiPath), 'dist'), { index: 'index.html' })); } } diff --git a/packages/editor-ui/index.js b/packages/editor-ui/index.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index e13f0244d3..f0bd46a4f3 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -7,6 +7,7 @@ "name": "Jan Oberhauser", "email": "jan@n8n.io" }, + "main": "index.js", "repository": { "type": "git", "url": "git+https://github.com/n8n-io/n8n.git"