react-email
react-email copied to clipboard
[bug] Dev server not starting
Currently, if you want to start the dev server, you will get the following error:
➜ npm run dev
> [email protected] dev
> email dev
✔ Emails preview generated
â ‹ Installing dependencies...
up to date, audited 584 packages in 3s
55 packages are looking for funding
run `npm fund` for details
7 vulnerabilities (2 moderate, 5 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
✔ Dependencies installed
> [email protected] dev
> next dev 3000
error - Invalid project directory provided, no such directory: /Users/bastiaanverhaar/Desktop/Darwin/outbound-communications/.react-email/3000
Specs:
- OS: MacOS 13.1
- Terminal: iTerm2 with Fish shell
- NodeJS: v18.13.0
- Package manager: NPM & Yarn
I found that the error is due to an incorrect shell command:
const startDevServer = (packageManager: string, port: string) => {
shell.exec(`${packageManager} run dev -p ${port}`, { async: true });
}
This code should be:
const startDevServer = (packageManager: string, port: string) => {
shell.exec(`${packageManager} run dev -- -p ${port}`, { async: true });
}
Source: https://stackoverflow.com/a/44743871
Will open a PR for it
Having the same issue on Windows, specs:
- OS: Windows 11 Home 22H2
- NodeJS: v18.13.0
- Package Manager: npm
1.7.10 should fix this.