How do I stop NPM from removing other node_modules?


(Jim B) #1

windows
version 6.4.0

What I Wanted to Do

Install a new module. such as ‘npm install jsox’, and have the remaining modules left alone.

What Happened Instead

jsox got installed and all others that were in dependencies in package.json wwere removed.

Reproduction Steps

Details

I edited the dependencies from

  "dependencies": {
    "json-6": "latest",
    "sack.vfs": "latest"
  }

to

  "dependencies": {
    "json-6": "latest",
    "jsox": "latest",
    "sack.vfs": "latest"
  }

and ran npm install jsox

in node_modules I previously had
‘.bin’ which had .json-6 bin installed
‘json-6’ (this is listed in the dependencides, and I would NOT have expected it to go away.
‘sack.vfs’ (with some active edits to the build for debugging; also my own package)
‘sack.vfs.x’ (a previous install of json-6 I saved sack.vfs here

after the install I got
‘.bin’ with only the bin utilities from jsox
‘jsox’ (the package I installed)
‘sack.vfs.x’ the untracked directory that was a backup of sack.vfs previously.

WHERE DID MY SACK.VFS and JSON-6 DIRECTORIES GO!?

Sorry, this has been an issue for a long time…
https://github.com/npm/npm/issues/17929 for instance - oepned on 5.3 and supposedly closed with 5.7.1
and many more I can find without much issue.

Resotring the old modules, I noticed that sack.vfs.x is also empty ; not sure if it should have been or not.


(system) #2

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.