Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloing project templates sometimes fails with an unhelpful error message #31

Closed
dillongrove opened this issue Jul 24, 2021 · 4 comments
Closed
Projects

Comments

@dillongrove
Copy link
Contributor

System: M1 MacBook Air

Running the create project command gives me:

% snap proj myproj
x Clone project template
could not find commit hash for main
ERROR: MISSING_REF

Some research indicates that this likely a problem with degit which is used to fetch project templates:
Rich-Harris/degit#37

Note that git is installed and available on PATH on this machine. Per the suggestion in the issue linked above, setting cache: false in degit options does seem to fix this issue in a pinch. However, that might not be a good long-term solution.

Others suggest that the XCode Command Line Utilities might need to be installed on Mac for this work. This machine actually does not have those installed, so I will try that soon and see if it works with cache: true. If so, we could make this part of the installation instructions.

Alternatively, we could look into other methods of fetching project templates (gittar is one that apparently has similar functionality but doesn't depend on git).

@dillongrove
Copy link
Contributor Author

Per conversation on 7/26/2021:
Try setting force: true, deleting cache, and trying again

@jasongitmail
Copy link
Contributor

jasongitmail commented Jul 27, 2021

Actually, instead, try clearing contents of ~/.degit and running npm install in the snapp-cli dir again. Then trying the command that caused the error.

@jasongitmail
Copy link
Contributor

I ended up using gittar to implement the example command b/c using two degit's calls felt like it'd get messy with its event emitter syntax.

It works well. I'm down to use gittar to work around this issue. Its syntax will end up slightly cleaner & looks like we'll be able to set it up for offline usage.

@jasongitmail
Copy link
Contributor

Fixed. Switched to gittar.

@jasongitmail jasongitmail added this to Done in MVP Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MVP
Done
Development

No branches or pull requests

2 participants