2

I'm studying astro framework. I tried some of template and it works great using this command

npm run dev

but I'm having problem with this official template.

https://astro.build/themes/details/astro-paper/

I run npm create astro@latest -- --template satnaing/astro-paper

and type npm run dev

12:41:45 [check] Checking files in watch mode
12:41:47 [content] Types generated 1.29s
√  Getting diagnostics for Astro files in 
C:\Users\mypc\Documents\astro_study\better-belt\…
12:41:52 [diagnostics] Result (19 files):
- 0 errors
- 0 warnings
- 0 hints

I got this message and dev server won't start.

Could some one teach me how to solve this please?

bluetail
  • 183
  • 8

2 Answers2

1

The template you've linked runs the following command when you run npm run dev.

astro check --watch & astro dev

The & symbol here allows the two commands to run in parallel, but it may not be supported by your terminal/shell. You can safely change the dev command to astro dev in package.json, and things should work normally. Alternatively, in the command line, you can run npx astro dev to run the dev server at any time.

{
  ...
  "scripts": {
    "dev": "astro dev",
    ...
  },
  ...
}
The Otterlord
  • 1,680
  • 10
  • 20
  • Dear @The Otterlord Thank you very much. It worked! Oh that's so difficult for me haha. I never figure out this. I spent lots of time. Thank you again! – bluetail Apr 27 '23 at 23:49
0

In order to run the development server in the local system for Astro, you simply need to run the below command in the terminal:

npm run start
Anurag Verma
  • 121
  • 7