1

I am watching a great YouTube series called Emacs From Scratch from System Crafters' YouTube channel. On episode #4, David Wilson talks about projectile.

His screen shows:

enter image description here

There is a pointer for the source on GitHub:

(use-package projectile
  :diminish projectile-mode
  :config (projectile-mode)
  :custom ((projectile-completion-system 'ivy))
  :bind-keymap
  ("C-c p" . projectile-command-map)
  :init
  ;; NOTE: Set this to the folder where you keep your Git repos!
  (when (file-directory-p "~/Projects/Code")
    (setq projectile-project-search-path '("~/Projects/Code")))
  (setq projectile-switch-project-action #'projectile-dired))

Unfortunately, this does not work. After quitting Emacs, when I re-started it, I was expecting the installation to be successful. However, there is a message in the Warning Buffer indicating:

Error (use-package): Failed to install projectile: https://melpa.org/packages/projectile-20220313.1334.el: Not found

This is weird because Projectile is listed on MELPA.

How can I fix this?

Thanks.

1
  • 1
    All the stuff about projectile-project-search-path is a red herring; you should remove it. The error message simply indicates that it tried to download the package and it failed.
    – db48x
    Apr 19, 2022 at 22:39

1 Answer 1

0

After executing M-x package-refresh-contents and re-starting Emacs, the previous error message was gone. Instead, there was this message:

Leaving directory ‘/home/pedro/.emacs.d/elpa/projectile-20220419.1102’

Compiling file /home/pedro/.emacs.d/elpa/projectile-20220419.1102/projectile.el at Tue Apr 19 19:35:59 2022
Entering directory ‘/home/pedro/.emacs.d/elpa/projectile-20220419.1102/’

Compiling internal form(s) at Tue Apr 19 19:35:59 2022
Warning (bytecomp): ‘(let ((version (or (projectile--pkg-version) projectile-version))))’ is a malformed function
Warning (bytecomp): reference to free variable ‘version’

After re-starting Emacs again, there was no message and Emacs had a normal start-up. Projectile seems to have been successfully installed. Not sure why it was necessary to refresh contents.

1
  • 1
    Look at the dates in the file name; you tried to download a file that was a month old and is, for whatever reason, no longer on the server.
    – db48x
    Apr 19, 2022 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.