You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Emacs打开文件报错:无法激活‘evil’包,依赖‘goto-chg-1.6’缺失求助

Troubleshooting the 'evil' Package Activation Error (Missing 'goto-chg-1.6')

I’ve run into similar dependency hiccups with Emacs packages before—let’s break down what’s likely going on and how to fix this step by step.

Possible Causes

Even if you didn’t modify your config or install new packages, here are common reasons this error pops up:

  • Local package files for goto-chg-1.6 got corrupted, deleted, or lost permissions (maybe from a system cleanup or disk glitch).
  • Your Emacs package archive index is outdated, so it can’t locate the required version of goto-chg.
  • The goto-chg package was temporarily removed from your configured package repository (unlikely, but possible for older Emacs versions like 25.1).

Step-by-Step Solutions

1. Refresh Package Archives and Reinstall goto-chg

This is the most straightforward fix:

  • Open Emacs and run M-x package-refresh-contents—this updates the list of available packages from your configured archives.
  • Next, run M-x package-install RET goto-chg RET to install the missing dependency.
  • Restart Emacs and try activating evil again.

2. Check for Corrupted/Deleted Local Package Files

If the first step doesn’t work, verify your local package directory:

  • Navigate to your Emacs package folder (usually ~/.emacs.d/elpa/) and look for a folder named goto-chg-1.6.
    • If it’s missing: The reinstall step above should recreate it.
    • If it exists but seems corrupted: Delete the folder entirely, then repeat the refresh/reinstall steps.
  • Ensure the directory has proper permissions by running this in your terminal:
    chmod -R 755 ~/.emacs.d/elpa/
    

3. Manually Install goto-chg If Package.el Can’t Find It

If package-install fails to locate goto-chg-1.6, you can install it manually:

  • Grab the raw goto-chg.el file (version 1.6) and save it to a directory in your Emacs load path (like ~/.emacs.d/lisp/).
  • Add this line to your init file (if not already present) to include the directory in your load path:
    (add-to-list 'load-path "~/.emacs.d/lisp/")
    
  • Add (require 'goto-chg) before the line that loads evil in your config.
  • Alternatively, use M-x package-install-file RET and select the downloaded goto-chg.el file to install it via Emacs’s package manager.

4. Verify Your Package Archives Include MELPA

goto-chg is hosted on MELPA, so if it’s not in your configured archives, Emacs can’t find it. Check if it’s listed by running M-x package-list-packages and looking at the top of the buffer. If not, add this to your init file:

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

Then run package-refresh-contents again and try reinstalling.

Note for Older Emacs Versions

Since you’re on Emacs 25.1 (a fairly old release), some packages might stop being supported in the main MELPA archive. If you run into recurring issues, consider switching to MELPA Stable by replacing the MELPA URL with https://stable.melpa.org/packages/—this hosts older, more stable versions of packages compatible with older Emacs releases.

内容的提问来源于stack exchange,提问作者UnSat

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 09:29:35