install npm workspace dependencies completely inside workspace

2.3k views Asked by At

Is it possible to run an npm ci --workspace=[some workspace] command and confine the installed dependencies inside that specific workspace directory, instead of bubbling up the shared ones to the project root node_modules folder?

Purpose: I have a mono repo, and I would like to install the workspace dependencies, respect the root package-lock, and have them all in one place inside that one workspace. So I can copy the whole specific workspace directory and run the server from another location. Otherwise, I have to carefully merge the two node_module folders using a script.

Am I not thinking of the best way to approach this, and is this possible regardless?

EDIT: This seems to be exactly what I'm describing https://github.com/npm/rfcs/issues/287

0

There are 0 answers