chore: reorganize docs apps (#7228)
* reorganize docs apps * add README * fix directory * add condition for old docs
This commit is contained in:
1 parent
224ebb2154
commit
4fe28f5a95
6187 files changed
+601447
-598226
No files matched your search
+3
@@ -0,0 +1,3 @@
|
||||
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.
|
||||
|
||||
Learn more in [NPM’s documentation](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally).
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
If you're using Powershell and you installed the CLI tool, but when you try to use it you get the error:
|
||||
|
||||
```bash noReport
|
||||
command not found: medusa
|
||||
```
|
||||
|
||||
Try closing your Powershell window and opening a new one.
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import { DetailsList } from "docs-ui"
|
||||
import PermissionErrorsSection from './permission-errors.md'
|
||||
import PowershellErrorSection from './powershell-error.md'
|
||||
import YarnErrorSection from './yarn-error.mdx'
|
||||
|
||||
<DetailsList
|
||||
sections={[
|
||||
{
|
||||
title: "NPM Error: EACCES Permissions Errors",
|
||||
content: <PermissionErrorsSection />
|
||||
},
|
||||
{
|
||||
title: "Powershell Error: command not found: medusa",
|
||||
content: <PowershellErrorSection />
|
||||
},
|
||||
{
|
||||
title: "Yarn Error: command not found: medusa",
|
||||
content: <YarnErrorSection />
|
||||
}
|
||||
]}
|
||||
/>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import { LegacyCodeTabs } from "docs-ui"
|
||||
|
||||
If you install the Medusa CLI tool with Yarn, then try to use the CLI tool but get the error:
|
||||
|
||||
```bash noReport
|
||||
command not found: medusa
|
||||
```
|
||||
|
||||
You have to add Yarn’s install location to the PATH variable:
|
||||
|
||||
<LegacyCodeTabs
|
||||
tabs={[
|
||||
{
|
||||
label: "MacOS / Linux",
|
||||
value: "unix",
|
||||
code: {
|
||||
lang: "bash",
|
||||
source: `export PATH="$(yarn global bin):$PATH"`
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Windows",
|
||||
value: "windows",
|
||||
code: {
|
||||
lang: "bash",
|
||||
source: `# MAKE SURE TO INCLUDE %path%
|
||||
setx path "%path%;c:\\users\\YOURUSERNAME\\appdata\\local\\yarnbin"
|
||||
# YOURUSERNAME is your account username`
|
||||
}
|
||||
}
|
||||
]}
|
||||
group="operating-systems"
|
||||
/>
|
||||
|
||||
You can learn more in [Yarn’s documentation](https://classic.yarnpkg.com/en/docs/cli/global#adding-the-install-location-to-your-path).
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { LegacyCodeTabs } from "docs-ui"
|
||||
|
||||
This error can occur while installing any of Medusa's projects (for example, Next.js Starter Template). There is no specific cause to this error.
|
||||
|
||||
One way to resolve it is by removing the `node_modules` directory in the project and re-installing the dependencies:
|
||||
|
||||
<LegacyCodeTabs tabs={[
|
||||
{
|
||||
label: "MacOS / Linux",
|
||||
value: "unix",
|
||||
code: {
|
||||
lang: "bash",
|
||||
source: `rm -rf node_modules
|
||||
yarn install`
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Windows",
|
||||
value: "windows",
|
||||
code: {
|
||||
lang: "bash",
|
||||
source: `rd /s /q node_modules
|
||||
yarn install`
|
||||
}
|
||||
}
|
||||
]} group="operating-systems" />
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
If you use the `--db-url` option with the `create-medusa-app` command and the connection to the database fails, try the following:
|
||||
|
||||
- Specify `?sslmode=require` at the end of the connection URL. Some PostgreSQL hosting providers, like Vercel, require passing this option. For example:
|
||||
|
||||
```bash
|
||||
npx create-medusa-app@latest --db-url "postgres://default:<password><host-region>.postgres.vercel-storage.com:5432/verceldb?sslmode=require"
|
||||
```
|
||||
|
||||
- Change the password to remove special characters. PostgreSQL requires encoding passwords if they have special characters. While the `create-medusa-app` command handles this automatically when you specify the password to the `create-medusa-app` command, when you pass a connection URL with the `--db-url` the command uses that URL as-is. So, you must either encode the special characters in the password yourself, or remove the special characters in the password.
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
When using the `create-medusa-app` npx command, you might run into an NPM `EAGAIN` error. This error can randomly occur due to conflicting processes.
|
||||
|
||||
The easiest solution is to start the command over. Alternatively, if your setup crossed the "create database" point, you can manually perform the following steps in the directory of your created project. You can skip any steps that you're sure have been performed by `create-medusa-app`:
|
||||
|
||||
1. Install dependencies:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Build project:
|
||||
|
||||
```bash npm2yarn
|
||||
npm run build
|
||||
```
|
||||
|
||||
3. Run migrations:
|
||||
|
||||
```bash
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
4. Create an admin user:
|
||||
|
||||
```bash
|
||||
npx medusa user -e user@test.com -p supersecret
|
||||
```
|
||||
|
||||
5. Optionally seed the database:
|
||||
|
||||
```bash
|
||||
npx medusa seed -f ./data/seed.json
|
||||
```
|
||||
|
||||
6. Start project:
|
||||
|
||||
```bash
|
||||
npx medusa develop
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
If you're running the Medusa backend through tools like VSCode or GitHub Codespaces, you must ensure that:
|
||||
|
||||
1. Port forwarding is configured for ports `9000` and `7001`. Refer to the following resources on how to configure forwarded ports:
|
||||
- [VSCode local development.](https://code.visualstudio.com/docs/editor/port-forwarding)
|
||||
- [VSCode remote development.](https://code.visualstudio.com/docs/remote/ssh#_forwarding-a-port-creating-ssh-tunnel)
|
||||
- [GitHub Codespaces.](https://docs.github.com/en/codespaces/developing-in-a-codespace/forwarding-ports-in-your-codespace)
|
||||
2. If your tool or IDE exposes an address other than `localhost`, such as `127.0.0.1`, make sure to add that address to the [admin_cors](/references/medusa-config) Medusa configuration. Your tool will show you what the forwarded address is.
|
||||
|
||||
After setting these configurations, run your Medusa backend and try again. If you couldn't create an admin user before, run the following command in the root directory of your Medusa project to create an admin user:
|
||||
|
||||
```bash
|
||||
npx medusa user -e admin@medusa-test.com -p supersecret
|
||||
```
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
If you use the `--no-browser` option with the `create-medusa-app` command, you'll find a URL outputted at the end of the command execution. This is the URL that you can use to set a password for your admin user.
|
||||
|
||||
However, if you copy the URL, then try later to access that URL, you may receive an "Invalid Token" error. This is because when you copy the URL, a lot of extra space may be added into the token. So, you must clear out the spaces within the token and the `||` characters, then try again.
|
||||
|
||||
Alternatively, you can create a new user with the [medusa user command](../../../medusa-cli/page.mdx#user).
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
import { Tabs, TabsList, TabsTrigger, TabsContent, TabsContentWrapper } from "docs-ui"
|
||||
|
||||
As a last resort to resolve your issue, please try to clear your `npx` cache, as it could hold a cached version of `create-medusa-app` with errors.
|
||||
|
||||
<Tabs defaultValue="unix">
|
||||
<TabsList>
|
||||
<TabsTrigger value="unix">MacOS / Linux</TabsTrigger>
|
||||
<TabsTrigger value="windows">Windows</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContentWrapper>
|
||||
<TabsContent value="unix">
|
||||
|
||||
Run the following command:
|
||||
|
||||
```bash
|
||||
rm -rf "$(npm config get cache)/_npx"
|
||||
```
|
||||
|
||||
Try running the `create-medusa-app` command again.
|
||||
|
||||
</TabsContent>
|
||||
<TabsContent value="windows">
|
||||
|
||||
First, find the cache directory with the following command:
|
||||
|
||||
```bash
|
||||
npm config get cache
|
||||
```
|
||||
|
||||
The npx cache should be in the directory `<NPM_CACHE>/_npx`, where `<NPM_CACHE>` is the cache directory returned by the previous command. Delete that directory and try running the `create-medusa-app` command again.
|
||||
|
||||
</TabsContent>
|
||||
</TabsContentWrapper>
|
||||
</Tabs>
|
||||
|
||||
If your issue persists, please try to search through [our GitHub issues](https://github.com/medusajs/medusa/issues) to see if there's a solution for your issue. If not, please [create an issue on GitHub](https://github.com/medusajs/medusa/issues/new?assignees=olivermrbl&labels=status:+needs+triaging,+type:+bug&template=bug_report.md&title=") and our team will help you resolve it soon."
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
This error typically occurs when you set up a Medusa project with `create-medusa-app` and try to run the Medusa backend.
|
||||
|
||||
To resolve this issue, make sure you change into the `backend` directory of the Medusa project you created before trying to start the Medusa backend:
|
||||
|
||||
```bash npm2yarn
|
||||
cd backend
|
||||
npx medusa develop
|
||||
```
|
||||
@@ -0,0 +1,10 @@
|
||||
When you start your Medusa backend you may run into the following error:
|
||||
|
||||
```bash
|
||||
Error: connect ECONNREFUSED ::1:5432
|
||||
```
|
||||
|
||||
This error occurs because the backend couldn't connect to the PostgreSQL database. The issue could be one of the following:
|
||||
|
||||
1. PostgreSQL server isn't running. Make sure it's always running while the Medusa backend is running.
|
||||
2. The connection URL to your PostgreSQL database is incorrect. This could be because of incorrect credentials, port number, or connection URL format. The format should be `postgres://[user][:password]@[host][:port]/[dbname]`. Make sure that the connection URL format is correct, and the credentials passed in the URL are correct. You can learn more about formatting the connection URL [here](/references/medusa-config#postgresql-configurations)
|
||||
@@ -0,0 +1,25 @@
|
||||
When connecting your Medusa backend to a PostgreSQL Docker container, make sure the `5432` port is exposed.
|
||||
|
||||
To do that, either pass the `-p` option to the `docker run` command. For example:
|
||||
|
||||
```bash
|
||||
docker run -d -p 5432:5432 --name some-postgres -e POSTGRES_PASSWORD=supersecret postgres
|
||||
```
|
||||
|
||||
Or, if you're using Docker Desktop, you can provide the option under the container's "Optional settings" collapsable.
|
||||
|
||||

|
||||
|
||||
If you expose the PostgreSQL docker container at a port other than `5432`, make sure to include it in your database URL.
|
||||
|
||||
When installing Medusa with `create-medusa-app`, you can provide a database URL with the different port using the `--db-url` option.
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
npx create-medusa-app@latest --db-url "postgres://user:password@localhost:<YOUR_PORT>/medusa-store"
|
||||
```
|
||||
|
||||
Where `<YOUR_PORT>` is the exposed port if it's different than `5432`.
|
||||
|
||||
Refer to the [database_url configuration documentation](/medusa-configurations#database_url) to learn how to set the database URL for an installed Medusa backend.
|
||||
@@ -0,0 +1,3 @@
|
||||
The database user you use in the `database_url` Medusa backend configuration must have create privileges. Otherwise, you'll face problems when running migrations.
|
||||
|
||||
If you're using the `postgres` superuser, then it should have these privileges by default. Otherwise, make sure to grant your user create privileges. You can learn how to do that in [PostgreSQL's documentation](https://www.postgresql.org/docs/current/ddl-priv.html).
|
||||
@@ -0,0 +1,18 @@
|
||||
You may get the following error while running `medusa new`:
|
||||
|
||||
```bash
|
||||
Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string
|
||||
```
|
||||
|
||||
If the error occurs while running `medusa new` and you've selected to enter your database credentials, either:
|
||||
|
||||
1. Make sure your database credentials are correct;
|
||||
2. Or choose the Skip option to skip entering your database credentials.
|
||||
|
||||
If the error occurs while running integration tests, make sure the following variable is set in your system's environment variable:
|
||||
|
||||
```bash
|
||||
DB_HOST=<YOUR_DB_HOST>
|
||||
DB_USERNAME=<YOUR_DB_USERNAME>
|
||||
DB_PASSWORD=<YOUR_PASSWORD>
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
By default, passing the `--with-nextjs-starter` to the `create-medusa-app` command starts both the Medusa application at `localhost:9000` and the Next.js Starter storefront at `localhost:8000` once the installation finishes successfully. The Medusa Admin also opens in your default browser.
|
||||
|
||||
If, while following along the setup process, you try to access the Next.js storefront and it's not working, try to run the storefront manually while the Medusa application is still running.
|
||||
|
||||
To do that, first, change to the directory of the storefront. The directory name is `{project_name}-storefront`, where `{project_name}` is the name you chose for the project while running the `create-medusa-app` command. For example:
|
||||
|
||||
```bash
|
||||
cd my-medusa-store-storefront
|
||||
```
|
||||
|
||||
Then, run the following command to start the storefront:
|
||||
|
||||
```bash npm2yarn
|
||||
npm run dev
|
||||
```
|
||||
|
||||
The storefront runs on `localhost:8000` now.
|
||||
@@ -0,0 +1,21 @@
|
||||
If you are experiencing connection issues when trying to access your Medusa backend from a storefront or the admin dashboard, it is most likely due to Cross-Origin Resource Sharing (CORS) issues.
|
||||
|
||||
You might see a log in your browser console, that looks like this:
|
||||
|
||||

|
||||
|
||||
In your `medusa-config.js` , you should ensure that you've configured your CORS settings correctly. By default, the Medusa starter runs on port `9000`, Medusa Admin runs on port `7001`, and the storefront starters run on port `8000`.
|
||||
|
||||
The default configuration uses the following CORS settings:
|
||||
|
||||
```js title="medusa-config.js"
|
||||
// CORS when consuming Medusa from admin
|
||||
const ADMIN_CORS = process.env.ADMIN_CORS ||
|
||||
"http://localhost:7000,http://localhost:7001"
|
||||
|
||||
// CORS to avoid issues when consuming Medusa from a client
|
||||
const STORE_CORS =
|
||||
process.env.STORE_CORS || "http://localhost:8000"
|
||||
```
|
||||
|
||||
If you wish to run your storefront or Medusa Admin on other ports, you should update the above settings accordingly.
|
||||
@@ -0,0 +1,14 @@
|
||||
When you run your backend you may run to an error similar to the following:
|
||||
|
||||
```bash
|
||||
code: 'EADDRINUSE',
|
||||
errno: -48,
|
||||
syscall: 'Listen',
|
||||
address: '::',
|
||||
port: 9000
|
||||
```
|
||||
|
||||
This means that there's another process running at port `9000`. You need to either:
|
||||
|
||||
- Change the default port used by the Medusa backend. You can do that by setting the `PORT` environment variable to a new port. When you do this, make sure to change the port used in other apps that interact with your Medusa backend, such as in your [admin](../admin/configuration.mdx#build-command-options) or [storefront](../starters/nextjs-medusa-starter.mdx#changing-medusa-backend-url).
|
||||
- Terminate other processes running on port `9000`.
|
||||
@@ -0,0 +1,14 @@
|
||||
If you're using the [S3 Plugin](../../../plugins/storage/s3/page.mdx) and, when you upload an image, you receive the following error on your Medusa backend:
|
||||
|
||||
```bash noReport
|
||||
AccessControlListNotSupported: The bucket does not allow ACLs
|
||||
```
|
||||
|
||||
Try the following:
|
||||
|
||||
1. Go to your S3 Bucket, then choose the Permissions tab.
|
||||
2. Scroll to Object Ownership and click the Edit button.
|
||||
3. Select ACLs enabled and choose for Object Ownership the radio button Bucket owner preferred.
|
||||
4. Click the Save Changes.
|
||||
|
||||
Try uploading again after making this change. Upload should be successful.
|
||||
Reference in new issue
Block a user