Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug connections to melpa with emacs

Tags:

emacs

I'm trying to add packages via melpa in my init file. It was working, but today it stopped. To debug, I started with "emacs -q" and typed the following into my scratch buffer:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/"))
(package-initialize)

The first two lines seem to work. The third line gives me an error and stack trace:

(wrong-type-argument arrayp nil)
package--add-to-archive-contents(nil "melpa")
package-read-archive-contents()

Is the error with my setup? Do I have the wrong url for melpa? I'm using GNU Emacs 24.5.1.

like image 269
sockmonk Avatar asked Feb 08 '23 14:02

sockmonk


1 Answers

Although I'm not very familiar with it, I took a quick look at the package.el code.

My guess is that your ~/.emacs.d/elpa/archives/melpa/archive-contents file is "corrupted". As a result, package--add-to-archive-contents is not finding an array for an element it would expect to get from that file.

I believe the archive-contents file is only a local cache. If you delete it, it will get rebuilt, and you should be all set.

like image 196
Greg Hendershott Avatar answered Feb 23 '23 11:02

Greg Hendershott