From ba3586fbe7889681da4afcc8700f8bee044e822c Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Fri, 10 Jan 2020 15:15:24 +0100 Subject: [PATCH] docs: update way to create strapi app in deployment guide By following a feedback on a Spectrum question, I updated the way to create the strapi app to respect the best practice. It will prevent global version issue. --- docs/3.0.0-beta.x/guides/deployment.md | 28 ++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/3.0.0-beta.x/guides/deployment.md b/docs/3.0.0-beta.x/guides/deployment.md index a21285399c..d6e6ce8fe3 100644 --- a/docs/3.0.0-beta.x/guides/deployment.md +++ b/docs/3.0.0-beta.x/guides/deployment.md @@ -62,8 +62,10 @@ NODE_ENV=production npm run build ```bash npm install cross-env ``` + Then in your `package.json` scripts section: -```bash + +```bash "production": "cross-env NODE_ENV=production npm run build" ``` @@ -96,7 +98,9 @@ NODE_ENV=production npm start ```bash npm install cross-env ``` + Then in your `package.json` scripts section: + ```bash "production": "cross-env NODE_ENV=production npm start" ``` @@ -1340,10 +1344,30 @@ If you plan to use **MongoDB** with your project, [refer to the create a Strapi `Path: ./` +:::: tabs + +::: tab yarn + +Use **yarn** to install the Strapi project (**recommended**). [Install yarn with these docs](https://yarnpkg.com/lang/en/docs/install/) + ```bash -strapi new my-project --quickstart +yarn create strapi-app my-project --quickstart ``` +::: + +::: tab npx + +Use **npm/npx** to install the Strapi project + +```bash +npx create-strapi-app my-project --quickstart +``` + +::: + +:::: + ::: tip When you use `--quickstart` to create a Strapi project locally, a **SQLite database** is used which is not compatible with Heroku. Therefore, another database option [must be chosen](#_6-heroku-database-set-up). :::