verdaccio icon indicating copy to clipboard operation
verdaccio copied to clipboard

Upload downloaded third-party offline.

Open HawtinZeng opened this issue 1 year ago • 3 comments

Hi, verdaccio team: Appreciate your hard working, this project has been designed meticulously. Recently I changed a job, which can only work at a offline PC, so I have to set up my own registry with all dependencies, not only my private package. Firstly ,I use the store cache to transfer third party packages, but I cannot search them. Besides, some nested dependencies cannot be cached. So I implement my own 'publish' entry in the web, this button can upload node_modules or a built package or a group of packages(@xxx/ directory in node_modules). the process behind of this button is: 1. generate tar gzip file. 2. generate manifest object. 3. call publish node-api. I haven't implement the integrity code generation, so we need to use npm install --no-verify to skip integrity check. Besides, the upload process must be excuted in secure context(in localhost or in https address) Recording 2024-10-08 at 21 52 33 The modified code is here, welcome have a try for offline registry setup !

HawtinZeng avatar Oct 08 '24 13:10 HawtinZeng

The coresponding docker image is here: https://hub.docker.com/repository/docker/hawtinzeng/verdaccio/general

HawtinZeng avatar Oct 08 '24 14:10 HawtinZeng

There's a plugin for the "offline scenario": https://www.npmjs.com/package/verdaccio-offline-storage

The missing download of nested dependencies (only scoped ones), is a known issue https://github.com/verdaccio/verdaccio/issues/4070 (I'm working on it)

mbtools avatar Oct 10 '24 00:10 mbtools

One more thing: By default, npm caches HTTP requests. This means npm will not request a package/tarball from Verdaccio if it is already cached. If you want to make sure everything is downloaded to Verdaccio, use the following:

npm config set prefer-online true

mbtools avatar Oct 10 '24 14:10 mbtools