#command not found: astro
4 messages · Page 1 of 1 (latest)
Hey! Yeah so this is because the astro command won't be a registered executable in your system's PATH. When you do npm run dev , npm then runs JS which gets the astro command from the npm executable bin.
You can run npx astro ... if you're using npm, or pnpm exec astro ... for pnpm and that'll use the Astro command
so even with npx, I must still prefix "astro" command with npx correct? I thought I made a mistake somewhere with installation.
yes, with npx you have to prefix, keep in mind that npx have an optimization that first checks if the executable is already present in the project, if so it uses it, if not it downloads it
the position it checks is in node_modules/.bin/astro for example
This works because when you install astro it adds that file in creates the executable at node_modules/.bin/astro
this is also what gets executed when using astro inside npm scripts