Error linking n8n-nodes-example - ts-node version dependency issue from typeorm

Thanks in advance!
Starting my first node creation project and going through the example on YouTube from the n8n channel “Learn how to build your own n8n nodes”.
Unfortunately pretty stuck right off the bat! I’ve cloned the repo, installed locally, installed n8n locally and globally, successfully run “npm link” in the nodes package, then get an error when linking the package to n8n. This is the specific output:

at …\npm\node_modules\n8n is :package: v0.213.0
╰─ npm link n8n-nodes-xata
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/ts-node
npm ERR! dev ts-node@“^9.1.1” from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional ts-node@“^10.7.0” from [email protected]
npm ERR! node_modules/typeorm
npm ERR! typeorm@“0.3.11” from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/ts-node
npm ERR! peerOptional ts-node@“^10.7.0” from [email protected]
npm ERR! node_modules/typeorm
npm ERR! typeorm@“0.3.11” from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:

I then tried to run with the “–force” command and while that does finish without an error (albeight lots of warnings) when I run “n8n start” I get the initial output of “Initializing n8n process” but then it just errors out with no further output and brings me back to a command prompt with n8n not starting.
Hope someone can help! lol

So after reading a bunch on StackOverflow it seemed to be a common theme to switch to yarn to get rid of these dependency issues. So I unlinked and uninstalled n8n and deleted package-lock.json from my nodes-example project, then I ran yarn install on my nodes-example project, ran yarn global add n8n to install n8n, then ran yarn link from within my nodes-example project which produced a successful link. I then navigated to my global yarn n8n folder and ran the yarn link package-folder-name command which went like this:
╭╴at …\global\node_modules\n8n is 📦 v0.213.0 ╰─ yarn link n8n-nodes-xata yarn link v1.22.19 warning ..\..\package.json: No license field success Using linked package for "n8n-nodes-xata". Done in 0.10s.
So all the linking is done, and I have a successful link when I run the npm ls --depth=- --link=true command as seen here:
╭╴at …\global\node_modules\n8n is 📦 v0.213.0 ╰─ npm ls --depth=0 --link=true [email protected] C:\Users\T3CH\AppData\Local\Yarn\Data\global\node_modules\n8n -- [email protected] extraneous -> .\D:\PROJECTS\MINE\WEB\n8n Node\n8n-nodes-xata

I did have to add my yarn bin directory to my PATH to get the n8n command to be recognized by the terminal, however, now when I start n8n the program starts just fine, but the example nodes in my local n8n-nodes-xata package do not show up… currently I have in the nodes folder “ExampleNode, HttpBin, and Xata”. When I go to “All” and “Search nodes…” they do not appear.

Perhaps our chief builder @marcus can help with this one?

Hey @Crypto_T3CH,
sorry to hear that you are having trouble. I just tried out installing the n8n-nodes-starter using npm without any issues. I am running [email protected].

Inside the package.json I named my project n8n-nodes-starter (by default it is n8n-nodes-<...> placeholder). Replace it with whatever you want to name your project.

# inside n8n-nodes-starter to create a globally installed link
npm install
npm run build
npm link

# inside your globally installed n8n
npm link n8n-nodes-starter

To figure out where your globally installed n8n is you can use npm list -g which tells you the location of your global npm modules.

From there you have to cd into node_modules/n8n and run npm link n8n-nodes-starter.

Thanks @marcus !! I don’t know what in the world was the issue before. I literally just saw your message and decided to re-try everything. I re-installed n8n globally which gave me v0.216.0. I cloned the n8n-nodes-starter repo and pulled it down locally, renamed the project, and ran the install,build, and link commands. Absolutely zero issues this time around and I don’t think I did anything different! Anyway, just glad it’s working now. Thanks so much for the response.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.