- Download all packages normally from npm or yarn
- Install https://www.npmjs.com/package/node-tgz-downloader to download all the tarballs associated your package-lock.json
- Command is
download-tgz package-lock package-lock.json
this will generate a tarballs/ in the root of your project - Upload the tgz to your private registry by defining first the .npmrc
- Run the script ./npmimport.sh to upload all the tarballs
Created
June 1, 2020 07:59
-
-
Save ChunAllen/e928b057d66bb92f227675f130b83952 to your computer and use it in GitHub Desktop.
Uploading to npm packages to private registry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Need to do this if you don't have npmrc | |
# REPOSITORY=http://your-private-registry | |
# npm login --registry=$REPOSITORY | |
PACKAGES_PATH=tarballs/ | |
for package in $PACKAGES_PATH/*/*/*.tgz; do | |
npm publish --registory=REPOSITORY $package | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment