@onlyfyio/prepare-node-env v3.0.0
prepare-node-env
Script to check, set up, and repair your local Node.js environment.
The UI Ops team has created a script that can help you set up your local environment correctly, with a focus on configuring your GitHub Packages tokens. It will guide you through the process, and make sure your tokens are valid and configured correctly.
To run it, use this command:
npm exec --@onlyfyio:registry="https://registry.npmjs.com" @onlyfyio/prepare-node-env@latest
What does it do?
- Checks that you run a supported Node.js version
If you don't pass this step,
brew install node
should do the trick.
- Checks that you have an environment that correctly reads
.node-version
and acts on it.
If you don't pass this step, install a Node.js version manager.
rtx
^1 orasdf
^2 are good options.
- Checks that you have
corepack
installed and enabled.
If you don't pass this step,
brew install corepack
should do the trick.
Finds you current tokens for npm and Yarn. Checks that they're still authorized and valid.
Offers to use your valid tokens, or create a new one. It will guide you through creating and authorizing a new token if you choose that option.
Saves your token in npm and Yarn in a normalized way.
^1: Remember to install the Node.js plugin with rtx plugin install nodejs
after setting up.
^2: Remember to install the Node.js plugin with asdf plugin add nodejs
after setting up, and set legacy-version-file=true
in ~/.asdfrc
.
Contributing
This project uses Conventional Commits.
To make a release, push your changes. Release Please will run and create a PR if there are any unreleased feat
or fix
commits. Merge that PR to publish a new version.
Versions are automatically published to both our internal GitHub Packages and the regular npm Registry, to help with users who can't yet log in to our internal registry.