System Information
- Strapi Version: 4.8.2
- Operating System: Windows
- Database: Mysql
- Node Version: v14.20.0
- NPM Version: 6.14.17
- Yarn Version: 1.22.19
The problem occurred when I was trying to deploy a staging environment and noticed this issue on startup.(I‘m sorry that my English is not good. Forgive me if I didn’t phrase it very clearly. ’)
The command I use:
$env:NODE_ENV=“production”
yarn start
The error message is as follows:
debug: ⛔️ Server wasn't able to start properly.
error: Missing jwtSecret. Please, set configuration variable "jwtSecret" for the users-permissions plugin in config/plugins.js (ex: you can generate one using Node with `crypto.randomBytes(16).toString('base64')`).
For security reasons, prefer storing the secret in an environment variable and read it in config/plugins.js. See https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html#configuration-using-environment-variables.
My structure:
The file: /config/env/production/database.js
The file: .env
Can you guys help me please.Thank you very much.