'"Error: Cannot open load file: No such file or directory, use-package" when I byte compile
When I byte compiled my init.el, I got the following error message.
➤ emacs --batch -f batch-byte-compile init.el
In toplevel form: init.el:12:1: Error: Cannot open load file: No such file or directory, use-package
and this is my init.el.
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(setq package-user-dir (expand-file-name "elpa" user-emacs-directory))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
Why did I get the error? How can I fix is?
Environment Info
➤ emacs --version
GNU Emacs 28.1
Copyright (C) 2022 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
OS: macOS Big Sur
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
