Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 33 additions & 45 deletions installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,11 @@ icon: "terminal"
<Steps>
<Step title="Install the CLI.">
Run the following command to install the [CLI](https://www.npmjs.com/package/mint):
<CodeGroup>

```bash npm
```bash
npm i -g mint
```


```bash yarn
yarn global add mint
```


```bash pnpm
pnpm add -g mint
```

</CodeGroup>
</Step>
<Step title="Preview locally.">
Navigate to your docs directory (where your `docs.json` file is located) and execute the following command:
Expand All @@ -54,24 +42,10 @@ icon: "terminal"

Alternatively, if you do not want to install the CLI globally, you can run a one-time script:

<CodeGroup>

```bash npm
```bash
npx mint dev
```


```bash yarn
yarn dlx mint dev
```


```bash pnpm
pnpm dlx mint dev
```

</CodeGroup>

## Updates

If your local preview is out of sync with what you see on the web in the production version, update your local CLI:
Expand All @@ -82,24 +56,10 @@ mint update

If this `mint update` command is not available on your local version, re-install the CLI with the latest version:

<CodeGroup>

```bash npm
```bash
npm i -g mint@latest
```


```bash yarn
yarn global upgrade mint
```


```bash pnpm
pnpm up --global mint
```

</CodeGroup>

## Custom ports

By default, the CLI uses port 3000. You can customize the port using the `--port` flag. To run the CLI on port 3333, for instance, use this command:
Expand Down Expand Up @@ -158,11 +118,39 @@ If you use JetBrains, we recommend the [MDX IntelliJ IDEA plugin](https://plugin
<Accordion title='Error: Could not load the "sharp" module using the darwin-arm64 runtime'>
This may be due to an outdated version of node. Try the following:

1. Remove the currently-installed version of the mint CLI: `npm remove -g mint`
1. Remove the currently-installed version of the mint CLI: `npm uninstall -g mint`
2. Upgrade to Node.js.
3. Reinstall the mint CLI: `npm install -g mint`
</Accordion>
<Accordion title="Issue: Encountering an unknown error">
Solution: Go to the root of your device and delete the `~/.mintlify` folder. Afterwards, run `mint dev` again.
**Solution**: Go to the root of your device and delete the `~/.mintlify` folder. Afterwards, run `mint dev` again.
</Accordion>
<Accordion title="Error: permission denied">
This is due to not having the required permissions to globally install node packages.

**Solution**: Try running `sudo npm i -g mint`. You will be prompted for your password, which is the one you use to unlock your computer.
</Accordion>
<Accordion title="The local preview doesn't look the same as my docs do on the web">
This is likely due to an outdated version of the CLI.

**Solution:** Run `mint update` to get the latest changes.
</Accordion>
<Accordion title="mintlify vs. mint package">
If you have any problems with the CLI package, you should first run `npm ls -g`. This command shows what packages are globally installed on your machine.

If you have a package named `mint` and a package named `mintlify` installed, you should uninstall `mintlify`.

1. Uninstall the old package:
```bash
npm uninstall -g mintlify
```
2. Clear your npm cache:
```bash
npm cache clean --force
```
3. Reinstall the new package:
```bash
npm install -g mint
```
</Accordion>
</AccordionGroup>