#Create Astro Project without copying files

17 messages · Page 1 of 1 (latest)

mossy mica
#

Is there a way to skip the copy template files when I create a new project. I am getting this error whenever I try to make a new project?

I get the same error with npm as well

Or perhaps specify a version maybe?

radiant meadow
#

I'd open an issue on the GitHub repo, but for now you can probably use degit to download an example repo. It won't do all the setup steps, but it should give you a working template.

For example, if you wanted the minimal template:

npx degit withastro/astro/examples/minimal meerkat
rocky veldtBOT
mossy mica
#

I got

! could not fetch remote https://github.com/withastro/astro
! could not find commit hash for HEAD
radiant meadow
#

hmm, that's odd. looks like you might be having issues with git/github?

#

are you able to clone other repos fine?

mossy mica
#

yes , I can clone fine

radiant meadow
#

then as a last resort, I guess you could clone the astro repo with --depth=1 and cp the example you want 😅 not very ideal though

mossy mica
#

so say i want the minimal one, the full command would be :

git clone https://github.com/withastro/astro --depth=1 cp minimal

like that?

radiant meadow
#

this to clone the astro repo (you'll only need to ever do this once)

git clone https://github.com/withastro/astro --depth=1

then this to copy an example to a folder

cp astro/examples/minimal my-app
mossy mica
#

as separate commands? one after the other?

radiant meadow
#

yep

mossy mica
#

Let me first say - i'm on windows

I did the the git clone - astro folder has been copied , the cp command says:cp: -r not specified; omitting directory 'astro/examples/minimal'

radiant meadow
#

ah yeah, -r copies recursively (also I think I slightly mistyped the command. you might need cp astro/examples/minimal/* my-app). either way you can copy via the command line, or using file explorer

mossy mica
#

Okay, I'll just do the file explorer stuff considering that's not what I am supposed to be doing anyway

#

Thank you