bbatsov / prelude

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.
https://prelude.emacsredux.com
5.13k stars 1.86k forks source link

Startup error: Package ‘company-lsp-’ is unavailable #1320

Closed pdewacht closed 3 years ago

pdewacht commented 3 years ago

I just installed prelude, using the installer script. I started emacs with no further configuration and I got this error.

  signal(error ("Package ‘company-lsp-’ is unavailable"))
  error("Package `%s-%s' is unavailable" company-lsp "")
  package-compute-transaction(nil ((company-lsp)))
  package-install(company-lsp)
  prelude-require-package(company-lsp)
  mapc(prelude-require-package (company-lsp lsp-mode lsp-ui))
  prelude-require-packages((company-lsp lsp-mode lsp-ui))
  eval-buffer(#<buffer  *load*-55422> nil "/home/pdewacht/.emacs.d/modules/prelude-lsp.el" nil t)  ; Reading at buffer position 1125
  load-with-code-conversion("/home/pdewacht/.emacs.d/modules/prelude-lsp.el" "/home/pdewacht/.emacs.d/modules/prelude-lsp.el" nil t)
  require(prelude-lsp)
  eval-buffer(#<buffer  *load*-714744> nil "/home/pdewacht/.emacs.d/personal/prelude-modules.e..." nil t)  ; Reading at buffer position 2816
  load-with-code-conversion("/home/pdewacht/.emacs.d/personal/prelude-modules.e..." "/home/pdewacht/.emacs.d/personal/prelude-modules.e..." nil nil)
  load("/home/pdewacht/.emacs.d/personal/prelude-modules.e...")
  (if (file-exists-p prelude-modules-file) (load prelude-modules-file) (message "[Prelude] Missing personal modules file %s" prelude-modules-file) (message "[Prelude] Falling back to the bundled example file...") (message "[Prelude] You should copy this file to your person...") (load (expand-file-name "sample/prelude-modules.el" user-emacs-directory)))
  eval-buffer(#<buffer  *load*> nil "/home/pdewacht/.emacs.d/init.el" nil t)  ; Reading at buffer position 5704
  load-with-code-conversion("/home/pdewacht/.emacs.d/init.el" "/home/pdewacht/.emacs.d/init.el" t t)
  load("/home/pdewacht/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x157fa0c6146d>) #f(compiled-function () #<bytecode 0x157fa0c61409>) t)
  command-line()
  normal-top-level()

Steps to reproduce the problem

emacs --debug-init

Environment & Version information

Emacs version

GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0) of 2020-11-08, modified by Debian

Operating system

Debian unstable, emacs package version 1:27.1+1-3

licht1stein commented 3 years ago

I just installed prelude and have the same problem. It seems company-lsp is not on MELPA at the moment.

image

I have opened an issue with company-lsp: https://github.com/tigersoldier/company-lsp/issues/147

licht1stein commented 3 years ago

As a workaround:

Create a file ~/.emacs.d/personal/preload/straight-use-package.el: This will install straight.el and then will use straight to install company-lsp from their github repo.

(setq package-enable-at-startup nil)

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package '(company-lsp :type git :host github :repo "tigersoldier/company-lsp"))

Modify ~/.emacs.d/modules/prelude-lsp.el Comment out company-lsp

(prelude-require-packages '(;company-lsp
                            lsp-mode
                            lsp-ui))

I'm still quite new to emacs, but as far as I understand this will install company-lsp before prelude loads, and will make it availabe to prelude. It will also prevent prelude from trying to get it from MELPA, where it's not available at the moment.

bbatsov commented 3 years ago

FYI - seems this package was deprecated and removed from MELPA (https://github.com/melpa/melpa/issues/7461)