'How to install node dependencies for custom package

i'm making a custom package for a project that i'm making, but it requires typescript to be installed as a local dependency...

npm i typescript @types/node ts-node ts-node-dev

This installs it in a node_modules folder, as per usual. The problem is though is when i try to locally install the package...

npm i ../package

it automatically creates a node_modules folder, and then installs it there. The package is installed inside a node_modules folder, within a package folder, within another node_modules folder.

My question is: how do i install it in the parent node_modules folder as a dependency alongside the custom one?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source