Skip to content

Commit e0e6650

Browse files
lawrekaethanpalm
andauthored
CLI docs update (#862)
* update cli docs * remove CodeGroup tags * format troubleshooting steps --------- Co-authored-by: Ethan Palm <[email protected]>
1 parent 2fcf753 commit e0e6650

File tree

1 file changed

+33
-45
lines changed

1 file changed

+33
-45
lines changed

installation.mdx

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,11 @@ icon: "terminal"
2323
<Steps>
2424
<Step title="Install the CLI.">
2525
Run the following command to install the [CLI](https://www.npmjs.com/package/mint):
26-
<CodeGroup>
2726

28-
```bash npm
27+
```bash
2928
npm i -g mint
3029
```
3130

32-
33-
```bash yarn
34-
yarn global add mint
35-
```
36-
37-
38-
```bash pnpm
39-
pnpm add -g mint
40-
```
41-
42-
</CodeGroup>
4331
</Step>
4432
<Step title="Preview locally.">
4533
Navigate to your docs directory (where your `docs.json` file is located) and execute the following command:
@@ -54,24 +42,10 @@ icon: "terminal"
5442

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

57-
<CodeGroup>
58-
59-
```bash npm
45+
```bash
6046
npx mint dev
6147
```
6248

63-
64-
```bash yarn
65-
yarn dlx mint dev
66-
```
67-
68-
69-
```bash pnpm
70-
pnpm dlx mint dev
71-
```
72-
73-
</CodeGroup>
74-
7549
## Updates
7650

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

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

85-
<CodeGroup>
86-
87-
```bash npm
59+
```bash
8860
npm i -g mint@latest
8961
```
9062

91-
92-
```bash yarn
93-
yarn global upgrade mint
94-
```
95-
96-
97-
```bash pnpm
98-
pnpm up --global mint
99-
```
100-
101-
</CodeGroup>
102-
10363
## Custom ports
10464

10565
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:
@@ -158,11 +118,39 @@ If you use JetBrains, we recommend the [MDX IntelliJ IDEA plugin](https://plugin
158118
<Accordion title='Error: Could not load the "sharp" module using the darwin-arm64 runtime'>
159119
This may be due to an outdated version of node. Try the following:
160120

161-
1. Remove the currently-installed version of the mint CLI: `npm remove -g mint`
121+
1. Remove the currently-installed version of the mint CLI: `npm uninstall -g mint`
162122
2. Upgrade to Node.js.
163123
3. Reinstall the mint CLI: `npm install -g mint`
164124
</Accordion>
165125
<Accordion title="Issue: Encountering an unknown error">
166-
Solution: Go to the root of your device and delete the `~/.mintlify` folder. Afterwards, run `mint dev` again.
126+
**Solution**: Go to the root of your device and delete the `~/.mintlify` folder. Afterwards, run `mint dev` again.
127+
</Accordion>
128+
<Accordion title="Error: permission denied">
129+
This is due to not having the required permissions to globally install node packages.
130+
131+
**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.
132+
</Accordion>
133+
<Accordion title="The local preview doesn't look the same as my docs do on the web">
134+
This is likely due to an outdated version of the CLI.
135+
136+
**Solution:** Run `mint update` to get the latest changes.
137+
</Accordion>
138+
<Accordion title="mintlify vs. mint package">
139+
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.
140+
141+
If you have a package named `mint` and a package named `mintlify` installed, you should uninstall `mintlify`.
142+
143+
1. Uninstall the old package:
144+
```bash
145+
npm uninstall -g mintlify
146+
```
147+
2. Clear your npm cache:
148+
```bash
149+
npm cache clean --force
150+
```
151+
3. Reinstall the new package:
152+
```bash
153+
npm install -g mint
154+
```
167155
</Accordion>
168156
</AccordionGroup>

0 commit comments

Comments
 (0)