development.mdx 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ---
  2. title: 'Development'
  3. description: 'Learn how to preview changes locally'
  4. ---
  5. <Info>
  6. **Prerequisite** You should have installed Node.js (version 18.10.0 or
  7. higher).
  8. </Info>
  9. Step 1. Install Mintlify on your OS:
  10. <CodeGroup>
  11. ```bash npm
  12. npm i -g mintlify
  13. ```
  14. ```bash yarn
  15. yarn global add mintlify
  16. ```
  17. </CodeGroup>
  18. Step 2. Go to the docs are located (where you can find `mint.json`) and run the following command:
  19. ```bash
  20. mintlify dev
  21. ```
  22. The documentation website is now available at `http://localhost:3000`.
  23. ### Custom Ports
  24. Mintlify uses port 3000 by default. You can use the `--port` flag to customize the port Mintlify runs on. For example, use this command to run in port 3333:
  25. ```bash
  26. mintlify dev --port 3333
  27. ```
  28. You will see an error like this if you try to run Mintlify in a port that's already taken:
  29. ```md
  30. Error: listen EADDRINUSE: address already in use :::3000
  31. ```
  32. ## Mintlify Versions
  33. Each CLI is linked to a specific version of Mintlify. Please update the CLI if your local website looks different than production.
  34. <CodeGroup>
  35. ```bash npm
  36. npm i -g mintlify@latest
  37. ```
  38. ```bash yarn
  39. yarn global upgrade mintlify
  40. ```
  41. </CodeGroup>
  42. ## Deployment
  43. <Tip>
  44. Unlimited editors available under the [Startup
  45. Plan](https://mintlify.com/pricing)
  46. </Tip>
  47. You should see the following if the deploy successfully went through:
  48. <Frame>
  49. <img src="/images/checks-passed.png" style={{ borderRadius: '0.5rem' }} />
  50. </Frame>
  51. ## Troubleshooting
  52. Here's how to solve some common problems when working with the CLI.
  53. <AccordionGroup>
  54. <Accordion title="Mintlify is not loading">
  55. Update to Node v18. Run `mintlify install` and try again.
  56. </Accordion>
  57. <Accordion title="No such file or directory on Windows">
  58. Go to the `C:/Users/Username/.mintlify/` directory and remove the `mint`
  59. folder. Then Open the Git Bash in this location and run `git clone
  60. https://github.com/mintlify/mint.git`.
  61. Repeat step 3.
  62. </Accordion>
  63. <Accordion title="Getting an unknown error">
  64. Try navigating to the root of your device and delete the ~/.mintlify folder.
  65. Then run `mintlify dev` again.
  66. </Accordion>
  67. </AccordionGroup>
  68. Curious about what changed in a CLI version? [Check out the CLI changelog.](/changelog/command-line)