I have been trying to install packages ivy, counsel, and swiper on Emacs 27 prelude. Starting Emacs results in the following error:

Warning (initialization): An error occurred while loading ‘/Users/username/.emacs.d/init.el’:

error: Could not create connection to melpa.org:443

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

Any ideas on why startup fails?

I was using the following init file as a reference point: https://github.com/sitesonix/emacs-prelude-personal/blob/26dab880d0d096a1f04e81b9ee6ba470563aef8f/rtg-init.el.


You may have to just use http instead of https

Here is what I have (essentially removed the s from https)

Not the perfect solution but something to get me going.

(setq package-enable-at-startup nil)
(add-to-list 'package-archives
         '("melpa" . "http://melpa.org/packages/"))
 (add-to-list 'package-archives
         '("gnu" . "http://elpa.gnu.org/packages/"))
;; (add-to-list 'package-archives
;;       '("melpa3" . "http://www.mirrorservice.org/sites/stable.melpa.org/packages/"))
;; Package.el stuff
| improve this answer | |

When installing newer Emacsen via Homebrew, use the gnutls switch:

brew reinstall emacs --HEAD --with-gnutls

Source: https://lists.gnu.org/archive/html/bug-gnu-emacs/2014-12/msg00439.html

| improve this answer | |
  • Note that you can accept your own answers. – Basil Mar 27 '18 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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