The issue arises from attempting to install packages in the phone storage directory (/storage/emulated) where your phone does not have full access. This means you may encounter limitations, such as being unable to create symlinks in that location. You can find more information about this constraint in the Termux documentation.
As a solution, it is advised to operate within your Termux partition ($HOME/$PREFIX). I have personally executed the same command there and obtained the following outcome:
~/git-repo/test $ npm i ts-node-dev -D
added 65 packages, and audited 66 packages in 2s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
While there are potential workarounds to enable functionality in the ~/storage partition, it may result in other accessibility issues. If you require access to files outside of Termux (e.g., through an IDE app), I have elaborated on this topic in response to a similar inquiry here.
I hope this information proves helpful.