I'm not sure this is your issue, but be aware that ~ (tilde) does NOT expand during Node.js execution or in most build tools — it’s only expanded by your shell (like zsh or bash).
If that's the problem, use the full absolute path instead