Prerequisite: Install Node.js (version 19 or higher) before proceeding.
Upgrade to
Upgrade to
docs.json before proceeding and delete the legacy mint.json file.Install and run Mintlify
Follow these steps to install and run Mintlify on your operating system:-
Install Mintlify:
-
Navigate to the docs directory (where the
docs.jsonfile is located) and start the local preview server:
http://localhost:3000. You now have a running local environment that mirrors the published Weave docs site.
Custom ports
By default, Mintlify uses port 3000. If port 3000 is already in use on your machine or you prefer to run multiple previews at once, use the--port flag to change the port Mintlify listens on. For example, to run Mintlify on port 3333, use this command:
Mintlify versions
Keep your CLI in sync with the production Mintlify version so your local preview matches what readers see on the published site. Each CLI release is associated with a specific version of Mintlify. If your local website doesn’t align with the production version, update the CLI:Validate links
Broken links degrade the reader experience, so check your changes for broken references before you open a pull request. The CLI can validate reference links in your documentation. To identify broken links, runmintlify broken-links:
Deployment
If the deployment is successful, you should see a confirmation message indicating that all checks have passed.Code formatting
Consistent MDX formatting makes your changes easier to review and reduces accidental syntax errors. Use extensions in your IDE to recognize and format MDX. If you’re a VSCode user, consider the MDX VSCode extension for syntax highlighting, and Prettier for code formatting.Troubleshooting
The following sections describe common issues you may encounter when you run the Mintlify CLI locally, along with their resolutions.Error: Could not load the "sharp" module using the darwin-arm64 runtime
Error: Could not load the "sharp" module using the darwin-arm64 runtime
This may be due to an outdated version of Node.js. Try the following:
- Remove the installed version of
mintlify:npm remove -g mintlify. - Upgrade to Node.js v19 or higher.
- Reinstall
mintlify:npm install -g mintlify.
Issue: Encountering an unknown error
Issue: Encountering an unknown error
Solution: Go to the root of your device and delete the
~/.mintlify folder. Afterward, run mintlify dev again.