Last active
September 28, 2024 20:24
-
-
Save robwierzbowski/9fdf661341ec99c3ea0f480f99ac2ea5 to your computer and use it in GitHub Desktop.
Configure yarn to use the npm registry directly
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 | |
# Remove all settings in the .npmrc except the required auth token setting. | |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc | |
# Create a new .yarnrc that specifies the npm registry, or append to an existing one. | |
echo 'registry: https://registry.npmjs.org/' >> .yarnrc | |
# Remove and regenerate the yarn.lock. This should be identical to running `yarn upgrade`. | |
# If you are uncomfortable regenerating the yarn.lock file, you can comment out the next | |
# two lines and try manually finding and replacing 'https://registry.yarnpkg.com/' with | |
# 'https://registry.npmjs.org/' | |
rm yarn.lock | |
yarn | |
# You can check that the registry has been set correctly by running `yarn config list`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment