-
Notifications
You must be signed in to change notification settings - Fork 12
add an option to not delete node_modules #3
Comments
I agree, this would be useful. |
i also raised the same issue in the npm issue tracker: https://npm.community/t/running-npm-ci-without-deleting-old-node-modules-folder-20104/3152/7 |
PR-URL: #1 Credit: @tareqhs Close: #3 Reviewed-by: @claudiahdz
I don't believe this should be closed. I believe the intent behind this ticket is to improve performance by not deleting the node_modules or the contents of node_modules. Rather, |
Fully agree with @seanmcilvenna. |
It is a fact that Having said so, the npm CLI team is currently working on v7 which includes a big refactor that aims to improve all aspects of the CLI (including making |
@claudiahdz I found here after seeing your post on npm.community.
Answers to these questions would make the decision to wait/hack-around a lot easier for those of us struggling with this. Thank you so much for your support! |
…e-lock.json for more informations see this thread : npm/libcipm#3
I'm managing CI servers with a large number js projects and i'm looking to optimize the duration and the IO spent on npm install, which represents a significant part of the total amount of the build.
I've been looking into npm ci as a replacement of npm install as soon as i heard of it, but was disappointed by the fact that npm ci deletes the whole node_modules, which makes it less efficient than npm install when a node_modules set up by a previous CI build is available.
I just discovered this cipm and give it a try. Here's the results of the tests I made on one js project installing 1200 modules. I measured the real user time, cpu time, system cpu time, and read and written MB by the process:
Main points:
The fact that cipm, as npm ci, deletes the whole node_modules, has a huge impact on duration and IO spent.
The best combination for now would be to use cipm during the initial build when there's no node_modules, and then use npm install.
But i think cipm could be faster than npm install if it did not delete node_modules.
Would it be possible to add a parameter to not delete node_modules?
As most of the files there won't change, there must be a smarter way to do this than deleting and reinstalling everything.
The text was updated successfully, but these errors were encountered: