1

I have a system that builds several node.js projects and maintains the node_modules cache of each project separately. I'm trying to migrate from npm 3 to npm 5 but the issue below is causing a lot of problems.

node_modules inside each project is a symbolic link to the real modules directory that is stored and maintained separately. While this worked like charm in npm 3, npm 5 keeps losing itself when npm install is re-invoked inside the same location. npm just keeps trying to remove/move everything over and over, and worse lose some packages sometimes.

These commands demosntrate the issue:

> cd <proj_folder>
> ln -s $(mktemp -d -p .) node_modules
> npm install grunt
   + grunt@1.0.2
   added 92 packages in 6.122s
> npm install grunt
   + grunt@1.0.2
   added 251 packages and updated 1 package in 7.584s

Am I missing something? please assist ..

thank you

Tareq Sha
  • 515
  • 4
  • 14
  • Possible duplicate of [Install npm local package dependencies](https://stackoverflow.com/questions/40774328/install-npm-local-package-dependencies) – str Feb 12 '18 at 11:19
  • Related: https://docs.npmjs.com/cli/link – str Feb 12 '18 at 11:24
  • @str thanks, but this is unrelated to "npm link" - I am not willing to make a global installation/linkage – Tareq Sha Feb 12 '18 at 11:49

0 Answers0