diff --git a/docs/content/advanced/backend/plugins/create.md b/docs/content/advanced/backend/plugins/create.md index 001244745a..9ace73804a 100644 --- a/docs/content/advanced/backend/plugins/create.md +++ b/docs/content/advanced/backend/plugins/create.md @@ -10,6 +10,12 @@ This guide uses the Medusa CLI throughout different steps. If you don’t have t npm install @medusajs/medusa-cli -g ``` +:::note + +If you run into any errors while installing the CLI tool, check out the [troubleshooting guide](../../../troubleshooting/cli-installation-errors.mdx). + +::: + ## Initialize Project The recommended way to create a plugin is using the Medusa CLI. Run the following command to create a new Medusa project: diff --git a/docs/content/cli/reference.md b/docs/content/cli/reference.md index a5aa35e647..3d1ab05797 100644 --- a/docs/content/cli/reference.md +++ b/docs/content/cli/reference.md @@ -16,6 +16,12 @@ To install the CLI tool, run the following command in your terminal: npm install @medusajs/medusa-cli -g ``` +:::note + +If you run into any errors while installing the CLI tool, check out the [troubleshooting guide](../troubleshooting/cli-installation-errors.mdx). + +::: + The CLI tool is then available under the `medusa` command. You can see all commands and options with the following command: ```bash diff --git a/docs/content/quickstart/quick-start.md b/docs/content/quickstart/quick-start.md index e5f090c382..f88bbdb228 100644 --- a/docs/content/quickstart/quick-start.md +++ b/docs/content/quickstart/quick-start.md @@ -22,7 +22,7 @@ You can install Node from the [official website](https://nodejs.org/en/). :::note -If you get a permission error when using NPM, check out [NPM's documentation for a solution](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally). +If you run into any errors while installing the CLI tool, check out the [troubleshooting guide](../troubleshooting/cli-installation-errors.mdx). ::: diff --git a/docs/content/troubleshooting/cli-installation-errors.mdx b/docs/content/troubleshooting/cli-installation-errors.mdx new file mode 100644 index 0000000000..92c05ecc13 --- /dev/null +++ b/docs/content/troubleshooting/cli-installation-errors.mdx @@ -0,0 +1,47 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Resolve Errors Installing Medusa CLI + +In this document, you can find solutions to some common problems that occur when installing Medusa’s CLI Tool. + +## NPM Error: EACCES Permissions Errors + +If you install the Medusa CLI tool with NPM and get a permission error, NPM proposes as a solution either re-installing NPM with a node version manager (nvm), or manually setting npm’s default directory. + +You can check out more information in [NPM’s documentation](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally). + + + +## Yarn Error: command not found: medusa + + + +If you install the Medusa CLI tool with Yarn, then try to use the CLI tool but get the error: + +```bash +command not found: medusa +``` + +You have to add Yarn’s install location to the PATH variable: + + + + +```bash +export PATH="$(yarn global bin):$PATH" +``` + + + + +```bash +# MAKE SURE TO INCLUDE %path% +setx path "%path%;c:\users\YOURUSERNAME\appdata\local\yarn\bin" +# YOURUSERNAME is your account username +``` + + + + +You can learn more in [Yarn’s documentation](https://classic.yarnpkg.com/en/docs/cli/global#adding-the-install-location-to-your-path). diff --git a/docs/content/tutorial/0-set-up-your-development-environment.mdx b/docs/content/tutorial/0-set-up-your-development-environment.mdx index ba7d817407..20538ffdb8 100644 --- a/docs/content/tutorial/0-set-up-your-development-environment.mdx +++ b/docs/content/tutorial/0-set-up-your-development-environment.mdx @@ -136,6 +136,12 @@ You can install Medusa’s CLI with the following command: npm install @medusajs/medusa-cli -g ``` +:::note + +If you run into any errors while installing the CLI tool, check out the [troubleshooting guide](../troubleshooting/cli-installation-errors.mdx). + +::: + ## Optional Tools These tools are not required to have to run a Medusa server, but it's highly recommended that you have them installed. diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 3f6aeaaab0..e1695937a4 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -510,6 +510,11 @@ module.exports = { type: "category", label: "Troubleshooting", items: [ + { + type: "doc", + id: "troubleshooting/cli-installation-errors", + label: "Errors Installing CLI", + }, { type: "doc", id: "troubleshooting/cors-issues",