Not able to create custom node (error TS18003)

I’m also facing the same problem.
I think, this problem is probably caused by --rootDir option of tsc does not effects as intended.

FYI, tsc command options are defined in <node_modules>n8n-node-dev\dist\src\Build.js shown below.

<node_modules>n8n-node-dev\dist\src\Build.js
let buildCommand = `${tscPath} --p ${tsconfigData.path} --outDir ${outputDirectory} --rootDir ${process.cwd()} --baseUrl ${nodeModulesPath}`;

And these options are specified like below.

  • --p: <User Directory>\AppData\Local\Temp\tmp-xxxxxxxxxxxxxxxxx (temporally project file)
  • --outDir: <User Directory>\.n8n\custom
  • --rootDir: <Current Directory>
  • --baseDir: <node_modules Directory>

As far as I tried, it seems that tsc searches input files only from the directory in where “temporally project file” exists and ignore the directory specified by --rootDir option.

I found this problem can be tentatibely fixed by specifying the “temporally project file” location shown below. @sathishvp2495

n8n-node-dev\dist\src\Build.js
// const { fd, path, cleanup } = await tmp_promise_1.file(); // current
const { fd, path, cleanup } = await tmp_promise_1.file( { dir: process.cwd() } ); // modified

After this modification, you can build nodes/credentials properly.
image

So I propose that Build.ts should be modified like shown below. @jan

// Write new custom tsconfig file
// const { fd, path, cleanup } = await file(); // current
const { fd, path, cleanup } = await file( { dir: process.cwd() } ); // modified