feat: Support community nodes on Windows (#3823)

* 🐛 Account for `APPDATA` in env

* 🐛 Prevent starter installation

* 🐛 Account for Win-style path delimiter

* 👕 Fix lint
This commit is contained in:
Iván Ovejero
2022-08-03 18:10:59 +02:00
committed by GitHub
parent 74cedd94a8
commit e8eda7470a
4 changed files with 21 additions and 2 deletions

View File

@@ -5,7 +5,11 @@ import { PublicInstalledPackage } from 'n8n-workflow';
import config from '../../config';
import { ResponseHelper, LoadNodesAndCredentials, Push, InternalHooksManager } from '..';
import { RESPONSE_ERROR_MESSAGES, UNKNOWN_FAILURE_REASON } from '../constants';
import {
RESPONSE_ERROR_MESSAGES,
UNKNOWN_FAILURE_REASON,
STARTER_TEMPLATE_NAME,
} from '../constants';
import {
matchMissingPackages,
matchPackagesWithUpdates,
@@ -80,6 +84,17 @@ nodesController.post(
);
}
if (parsed.packageName === STARTER_TEMPLATE_NAME) {
throw new ResponseHelper.ResponseError(
[
`Package "${parsed.packageName}" is only a template`,
'Please enter an actual package to install',
].join('.'),
undefined,
400,
);
}
const isInstalled = await isPackageInstalled(parsed.packageName);
const hasLoaded = hasPackageLoaded(name);