Org roam installs every time I start emacs

I’m using Emacs 27.2 with Spacemacs.

I installed org roam using M-x package-install RET.

I added the org roam pacakage options in my init.el file. It looks like this:

(use-package org-roam
  :ensure t
  :init
  (setq org-roam-v2-ack t)
  :custom
  (org-roam-directory "~/roam_notes/")
  (org-roam-completion-everywhere t)
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ("C-c n i" . org-roam-node-insert)
         ("C-c n o" . org-id-get-create)
         ("C-c n t" . org-roam-tag-add)
         ("C-c n a" . org-roam-alias-add)
         ("C-c n l" . org-roam-buffer-toggle)
         :map org-mode-map
         ("C-M-i" . completion-at-point)
         :map org-roam-dailies-map
         ("Y" . org-roam-dailies-capture-yesterday)
         ("T" . org-roam-dailies-capture-tomorrow))
  :bind-keymap
  ("C-c n d" . org-roam-dailies-map)
  :config
  (require 'org-roam-dailies) ;; Ensure the keymap is available
  (org-roam-db-autosync-mode))

Every time I start emacs, org roam starts installing. That’s because it somehow fails to install somehow. I get the following in the compile log:

In toplevel form:
org-roam-capture.el:708:1:Warning: variable ‘_’ not left unused

In end of data:
org-roam-db.el:767:1:Warning: the function ‘org-cite-parse-objects’ is not
    known to be defined.

Also, when emacs starts and finds org roam it tells me:

Found 1 orphan package(s) to delete...
--> deleting org-roam... [1/1]

How can I fix this issue? I’d highly appreciate it, since starting emacs takes forever.

I think I’ve figured it out. I never used Spacemacs until recently and I was used to Emacs init.el configurations. In short, don’t use init.el configurations in Spacemacs. I should’ve read this first:
https://thume.ca/howto/2015/03/07/configuring-spacemacs-a-tutorial/

I then stumbled upon this thread:

And configured Spacemacs as described there. The only difference was the exclusion of

(org :packages (not org-roam))

from the settings. I didn’t ignore org-roam because it didn’t work with that command. And now both org-roam and org-roam-ui are installed and working.

Here is my configuration:

   dotspacemacs-additional-packages '(
                                      sqlite3
                                      (org-roam)
                                      (org-roam-ui :location (recipe :fetcher github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out")))
                                      )
(defun dotspacemacs/user-config ()

  (require 'org)
  (setq org-enable-roam-support t)

  (use-package org-roam
    :after org
    :ensure t
    :init
    (setq org-roam-v2-ack t)
    :custom
    (org-roam-directory "~/roam_notes/")  ;; change this to your folder
    (org-roam-completion-everywhere t)
    :bind (("C-c n l" . org-roam-buffer-toggle)
           ("C-c n f" . org-roam-node-find)
           ("C-c n i" . org-roam-node-insert)
           ("C-c n o" . org-id-get-create)
           ("C-c n t" . org-roam-tag-add)
           ("C-c n a" . org-roam-alias-add)
           ("C-c n l" . org-roam-buffer-toggle)
           :map org-mode-map
           ("C-M-i" . completion-at-point)
           :map org-roam-dailies-map
           ("Y" . org-roam-dailies-capture-yesterday)
           ("T" . org-roam-dailies-capture-tomorrow))
    :bind-keymap
    ("C-c n d" . org-roam-dailies-map)
    :config
    (require 'org-roam-dailies) ;; Ensure the keymap is available
    (org-roam-db-autosync-mode))
)

1 Like