Both of those options look ok to me once you have finished working on your node but during development a common approach would be to use npm link which I think is the approach we document.
There are other things you can try depending on how your current production environment is configured.
If it is testing the publish and install I would just publish it to npm then in n8n under the settings you can use the community nodes feature to install it.
My node has a few resourceLocator fields that fill well on local but fail on remote.
I am sure that credentials at remote are fine because rest api returns a necessary list via http node with the same creds and I can not figure out a way to troubleshoot what is going wrong on remote.
update -
it throws an error
message “fetch is not defined”
It looks like the wrapper I consume uses fetch from node 18. Looks like i will have to make a node 18 n8n docker or switch to REST API.
That would be it, if you are using n8n in a container we use node 16. We tend to avoid too many other packages and if it is just http calls most nodes will manually implement them