0

I tried updating packages doing list-packages and U only to have emacs freeze half way through. I had to kill emacs. When trying to upgrade again, emacs said all packages are up to date.

However, now when I try to start emacs, I always get the emacs -Q like looking UI with an error prompt: Install missing grammars?

The following tree-sitter grammars are/were missing: janet 

Which I answer y, or even n, but it doesn't matter. Emacs will then startup correctly, but the next time I open it, the same error prompt will show up again.

Any ideas on how to fix this?

Edit: to add a bit of context, I do not use the janet programming language at all.

I'm trying now to see if removing the elpa directory and starting emacs again, which should force it to reinstall everything, will work. If not, I guess some new version of a package is causing issues.

Edit 2: After trying to load emacs, init is breaking because org-roam doesn't seem to work. Now even when I remove the line in my init file that uses it, it still somehow breaks. Using --debug-init it looks like package-install-selected-packages is somehow calling roam to be installed, though I can't see how. I'm wondering if somehow because custom.el contains a roam line, it's getting installed from there. Though I'm not sure what to do about this.

emacs 29.4, macos

Edit 3: I had another error which was failing to install org-roam. I removed that from my init.el file, and yet it was still failing.

4
  • What's the Emacs version? Presumably, there is no problem if you start with emacs -Q or emacs -q. You can bisect (or debug) your init file to see where the message is coming from and investigate from there. Deleting the elpa directory is a big hammer, but if it works, it does avoid you having to do detective work. BTW, I would search for the error message in your elpa directory: AFAICT, nothing in the emacs tree produces either of them. Commented Jan 20 at 15:36
  • Hi, thanks for the reply. emacs 29.4 on a mac. emacs -Q works, and emacs --init-debug doesn't really show me what's broken. It says failing to install roam, and points to a line in my init file which calls package-install-selected-packages, but doesn't mention roam at all. Not sure how to proceed Commented Jan 20 at 16:09
  • Did the elpa deletion and reinstallation method not work? I would try installing roam on its own, with M-x package-install and see if and how that fails. Commented Jan 20 at 16:33
  • Thanks for the help! Finally it worked. I basically removed the 'org-roam' entry in the custom.el file (even though it has a warning not to edit it by hand), and emacs loaded. Then I just did a manual list-packages to search for org-roam and it had an incompatibility issue from melpa-stable, but there was an alternative to use regular melpa, which worked. Now everything works. Thanks! I will try to post an answer with what I did in case it helps other people debug their configurations Commented Jan 20 at 16:49

1 Answer 1

0

There were multiple issues that had to be solved. Here I will explain the different solutions.

  1. If you have a package install error: if you have removed an offending line from your init.el file and the startup still breaks: check your custom.el file, or wherever it is that you set your custom settings to be set (check your init.el file for that), and check if the package which cannot be installed is there. This is what happened to me with org-roam. It says to be careful when editing by hand. Simply remove the offending package (probably a good idea to backup your custom.el before any changes), and try starting emacs again.
  2. for the tree-sitter grammars: I had some script brought from system crafters which would install all grammars according to their ide configs. I basically just removed this line. The issue is basically trying to install a grammar for which tree-sitter doesn't have one defined. If your system is different, try to find out what's causing tree-sitter to install a grammar.
  3. For org-roam specifically. Since recently, the sqlite support for emacs and org roam has changed. If you have a previous install, make sure to remove any emacsql-sqlite-builtin or emacsql-sqlite installs you may have had. Note that the melpa-stable version of org-roam is not working well because of outdated dependencies. Instead, install the regular melpa version. In fact, doing list-packages and searching for org-roam showed that the available version was incompatible because of unavailable dependencies. Going into the buffer by pressing enter on the cursor there, will show you a new buffer which should have alternative versions (make sure you have configured access to melpa for installing packages). Just press enter once your cursor is on the melpa or alternative version and hopefully it should be compatible. Install from there.

After doing this, all other packages should work.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.