Not able to create custom node (error TS18003)

For reference, this is a working “hack” which requires a custom “tsconfig-build.json” within your own n8n-nodes-custom-nodes project:

async function buildFiles(options) {
    options = options || {};
    let typescriptPath;
	const tsconfigData = await createCustomTsconfig();
    if (process.platform === 'win32') {
        typescriptPath = '../../node_modules/TypeScript/lib/tsc';
		tsconfigData.path = path_1.join(process.cwd(), 'tsconfig-build.json');
    }
    else {
        typescriptPath = '../../node_modules/.bin/tsc';
    }

The issue ist still the same as two years ago: tsc resolves files in the directory where --p points to. The --rootDir as stated in the docs does NOT change the path for the include resolution.
Thus - on Windows - the tsconfig-build.json has to be called within the custom nodes project folder to make it work.

1 Like