DEV Community

Discussion on: Using Vite with Inertia — Laravel, Vue & Tailwind

Collapse
 
fkranenburg profile image
Ferry Kranenburg

I got this error while following this article, any ideas? I started the app with 'npm run dev' and got this:

'printf' is not recognized as an internal or external command,

Collapse
 
fkranenburg profile image
Ferry Kranenburg

If anyone is running npm in command prompt, change script in package.json to this:

"scripts": {
    "predev": "echo dev > public/hot",
    "dev": "vite",
    "preprod": "echo prod > public/hot",
    "prod": "vite build"
}
Enter fullscreen mode Exit fullscreen mode

Because 'echo' adds a newline at the end of the file you also need to change vite.php this line:

$devServerIsRunning = str_contains(file_get_contents(public_path('hot')), 'dev');

Collapse
 
bertugkorucu profile image
Bertug Korucu

Yeah, that was the reason I used printf instead of echo