Not able to create custom node (error TS18003)

I’m trying to create a node by using this link. but i have an error error TS18003.
I tried so many times. can you please help me how to fix it. Thanks!

Very sorry to hear that you have problems!

Is there a node to build in the folders in mentions? Does it end with “.node.ts”?

It is quite possible that the problem is windows related. I am “sadly” not a windows users so can be not much help here myself right now. Anybody else out there which uses windows and tried to build a node with “n8n-node-dev”?

yea.
node.ts file is in that folder

and then

After execute n8n-node-dev build this command i got this The nodes got build and saved into the following folder:
C:\Users\sathi.n8n\custom
but the folder is not created.

Hi All,
Is their any update on this, Because iam facing the same issues. I want to develop a Kafka Topic consumer Trigger but not able to get a head start into this. Please help
Regards
Srikanth.J

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

@stm32p103 Welcome to the community and thanks a lot for looking into it!

The problem I had with this issue was that I was unable to debug it as it worked fine for me. So really appreciated that you had a closer look. I made the change you did propose. It did not make a difference for me and still works. So if that fixes the issue for you and some other people no reason not to add it.

Did just release a new version [email protected]. I hope that fixes now the issue for you and everybody. Thanks again!

1 Like

@jan Thank you for the quick response!
I’ve confirmed “error TS18003” does not occur after updated to 0.6.0.
(btw, I’m using Windows 10 Professional 64bit, Node.js 12.8.0, Typescript 3.6.2)

Great to hear! Thanks a lot for finding the solution!