It looks like back in July 2024 (over 4 months ago), n8n-nodes-starter changed from using npm to only use pnpm in order to match the package manager that n8n uses (PR#41). However, the Build a declarative style node tutorial has not been updated to reflect this change. This has led to a lot of frustration and grief trying to follow the tutorial to make a custom node work.
The tutorial says to run npm i, which produces a use "pnpm install" message.
pnpm install appears to work
npm run build and pnpm run build both do not work
npm link and pnpm link both do not work
npm link <node-package-name> and pnpm link <node-package-name> both do not work
Can you please let me know how I can make the n8n-nodes-starter code work with the new pnpm change?
I ended up reverting back to an old version of package.json that uses npm instead of pnpm. I can get the custom node to work this way. It would still be nice to get some guidance on how to make it work with pnpm if this is n8n’s package manager of choice moving forward.
Key is package name, one you made pnpm link with, and file path is folder location of your node.
So now, i just:
pnpm run build in node directory
pnpm install in ~/.n8n/custom directory
n8n → to run
Every time wanna test the node.
Also, not related to the topic, but https://webhook.site/ made my life easier! in my local n8n, having two credentials one with base url of the real service i’m building for, the other one has base url from that website. Switching between them in testing to see the actual URL called by n8n.
Note; made custom base-url variable in credentials, and uses that in calls.