0

从今天开始,我无法在 App 快捷方式和终端上打开 vs code。当我尝试运行与 VS Code 等相关的任何命令时codecode --version我收到此错误:

Loading "minimist" failed
Error: EIO: i/o error, read
    at Object.readSync (fs.js:592:3)
    at Object.p.internalModuleReadJSON (electron/js2c/asar_bundle.js:5:11493)
    at Object.read (internal/modules/package_json_reader.js:21:52)
    at readPackage (internal/modules/cjs/loader.js:253:36)
    at resolveExports (internal/modules/cjs/loader.js:436:15)
    at Function.Module._findPath (internal/modules/cjs/loader.js:479:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:921:27)
    at Module._load (internal/modules/cjs/loader.js:779:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:1006:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at r (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:5:101)
    at e.load (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:4:1723)
    at e.load (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:3:10695)
    at d (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:5:10300)
    at Object.errorback (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:5:10421)
    at e.triggerErrorback (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:3:11059)
    at /snap/code/83/usr/share/code/resources/app/out/vs/loader.js:3:10765
    at e.load (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:4:1740)
    at e.load (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:3:10695)
    at d (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:5:10300)
    at i._loadModule (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:5:10430)
    at i._resolve (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:6:452)
    at i.defineModule (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:5:6142)
    at v (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:6:1702)
    at g (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:4:2557)
    at Object.<anonymous> (/snap/code/83/usr/share/code/resources/app/out/vs/code/node/cli.js:9:115415)
    at Object.<anonymous> (/snap/code/83/usr/share/code/resources/app/out/vs/code/node/cli.js:12:18613)
    at e._createAndEvalScript (/snap/code/83/usr/share/code/resources/app/out/vs/loader.js:4:2601)
    at /snap/code/83/usr/share/code/resources/app/out/vs/loader.js:4:2240
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) {
  errno: -5,
  syscall: 'read',
  code: 'EIO',
  phase: 'loading',
  moduleId: 'minimist',
  neededBy: [ 'vs/platform/environment/node/argv' ]
}
Here are the modules that depend on it:
[ 'vs/platform/environment/node/argv' ]
4

2 回答 2

0

尝试使用全局安装 minimist npm 包

npm install -g minimist
于 2021-12-11T11:27:23.673 回答
0

不小心删除了一些包。通过重新安装 VS Code 解决。

于 2021-12-13T06:18:19.530 回答