opened 07:41AM - 13 Jun 24 UTC
issue: bug
severity: medium
status: confirmed
source: cli
version: 5
<!--
Hello 👋 Thank you for submitting an issue.
Before you start, please mak…e sure your issue is understandable and reproducible.
To make your issue readable make sure you use valid Markdown syntax.
https://guides.github.com/features/mastering-markdown/
Please ensure you have also read and understand the contributing guide.
https://github.com/strapi/strapi/blob/main/CONTRIBUTING.md#reporting-an-issue
-->
## Bug report
### Required System information
- Node.js version: 20.13.1
- NPM version: 10.0.1
- Strapi version: v5.0.0-beta10
- Database: sqlite
- Operating system: Windows / Mac
- Is your project Javascript or Typescript: Javascript / Typescript
### Describe the bug
INSERT HERE
### Steps to reproduce the behavior
1. run `npx create-strapi-app@v5.0.0-beta.10 myproject`
2. Let the CLI finish
4. Try run `npm run develop`
Sometimes here you can see Error 1 (Please see code snippets below)
5. If Error 1 (Please see code snippet below) run `npm install` and it goes away.
6. Run `npm run develop`
The outcome now would be Error 2 (Please see code snippet and screenshot below)
This seems to be because of the changes in `.env`
```.env
# Server
HOST=0.0.0.0
PORT=1337
# Secrets
APP_KEYS=XYZ
API_TOKEN_SALT=XYZ
ADMIN_JWT_SECRET=XYZ
TRANSFER_TOKEN_SALT=XYZ
# Database
DATABASE_CLIENT=sqlite
DATABASE_FILENAME=
```
Note that the DATABASE_FILENAME is blank and does not point to `.tmp/data.db`
Also, there is no `JWT_SECRET`
All of this was in `Beta-9`
### Expected behavior
When using the CLI the DATABASE_FILENAME= should be filled out to allow strapi to be installed.
### Screenshots

### Code snippets
If applicable, add code samples to help explain your problem.
Error 1)
```bash
npm run develop
> beta-10@0.1.0 develop
> strapi develop
node:internal/modules/cjs/loader:1148
throw err;
^
Error: Cannot find module 'ajv/dist/core'
Require stack:
- /Users/eventyret/Playground/beta10/node_modules/ajv-draft-04/dist/index.js
- /Users/eventyret/Playground/beta10/node_modules/@rushstack/node-core-library/lib/JsonSchema.js
- /Users/eventyret/Playground/beta10/node_modules/@rushstack/node-core-library/lib/index.js
- /Users/eventyret/Playground/beta10/node_modules/@rushstack/terminal/lib/NormalizeNewlinesTextRewriter.js
- /Users/eventyret/Playground/beta10/node_modules/@rushstack/terminal/lib/index.js
- /Users/eventyret/Playground/beta10/node_modules/@rushstack/ts-command-line/lib/providers/CommandLineParser.js
- /Users/eventyret/Playground/beta10/node_modules/@rushstack/ts-command-line/lib/providers/ScopedCommandLineAction.js
- /Users/eventyret/Playground/beta10/node_modules/@rushstack/ts-command-line/lib/index.js
- /Users/eventyret/Playground/beta10/node_modules/umzug/lib/cli.js
- /Users/eventyret/Playground/beta10/node_modules/umzug/lib/umzug.js
- /Users/eventyret/Playground/beta10/node_modules/umzug/lib/index.js
- /Users/eventyret/Playground/beta10/node_modules/@strapi/database/dist/index.js
- /Users/eventyret/Playground/beta10/node_modules/@strapi/core/dist/Strapi.js
- /Users/eventyret/Playground/beta10/node_modules/@strapi/core/dist/index.js
- /Users/eventyret/Playground/beta10/node_modules/@strapi/strapi/dist/cli/commands/admin/create-user.js
- /Users/eventyret/Playground/beta10/node_modules/@strapi/strapi/dist/cli/commands/index.js
- /Users/eventyret/Playground/beta10/node_modules/@strapi/strapi/dist/cli/index.js
- /Users/eventyret/Playground/beta10/node_modules/@strapi/strapi/bin/strapi.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/Users/eventyret/Playground/beta10/node_modules/ajv-draft-04/dist/index.js:4:16)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/eventyret/Playground/beta10/node_modules/ajv-draft-04/dist/index.js',
'/Users/eventyret/Playground/beta10/node_modules/@rushstack/node-core-library/lib/JsonSchema.js',
'/Users/eventyret/Playground/beta10/node_modules/@rushstack/node-core-library/lib/index.js',
'/Users/eventyret/Playground/beta10/node_modules/@rushstack/terminal/lib/NormalizeNewlinesTextRewriter.js',
'/Users/eventyret/Playground/beta10/node_modules/@rushstack/terminal/lib/index.js',
'/Users/eventyret/Playground/beta10/node_modules/@rushstack/ts-command-line/lib/providers/CommandLineParser.js',
'/Users/eventyret/Playground/beta10/node_modules/@rushstack/ts-command-line/lib/providers/ScopedCommandLineAction.js',
'/Users/eventyret/Playground/beta10/node_modules/@rushstack/ts-command-line/lib/index.js',
'/Users/eventyret/Playground/beta10/node_modules/umzug/lib/cli.js',
'/Users/eventyret/Playground/beta10/node_modules/umzug/lib/umzug.js',
'/Users/eventyret/Playground/beta10/node_modules/umzug/lib/index.js',
'/Users/eventyret/Playground/beta10/node_modules/@strapi/database/dist/index.js',
'/Users/eventyret/Playground/beta10/node_modules/@strapi/core/dist/Strapi.js',
'/Users/eventyret/Playground/beta10/node_modules/@strapi/core/dist/index.js',
'/Users/eventyret/Playground/beta10/node_modules/@strapi/strapi/dist/cli/commands/admin/create-user.js',
'/Users/eventyret/Playground/beta10/node_modules/@strapi/strapi/dist/cli/commands/index.js',
'/Users/eventyret/Playground/beta10/node_modules/@strapi/strapi/dist/cli/index.js',
'/Users/eventyret/Playground/beta10/node_modules/@strapi/strapi/bin/strapi.js'
]
}
```
ERROR 2:
```
npm run develop
> beta-10@0.1.0 develop
> strapi develop
✔ Cleaning dist dir (6ms)
⠋ Loading Strapi⠋ Building build context
[INFO] Including the following ENV variables as part of the JS bundle:
- ADMIN_PATH
- STRAPI_ADMIN_BACKEND_URL
- STRAPI_TELEMETRY_DISABLED
✔ Building build context (246ms)
✔ Creating admin (190ms)
⠴ Loading Strapi[ERROR] There seems to be an unexpected error, try again with --debug for more information
```
### Additional context
You can do two workarounds for this.
For the first error, run `npm run install` again
For the database not found copy in `DATABASE_FILENAME=.tmp/data.db` into `.env` and it should be working again