从今天起,我无法在应用程序快捷方式和终端上打开vs代码。当我尝试运行任何与VS代码相关的命令时,如code
、code --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' ]
尝试使用全局安装minimit npm包
npm install -g minimist
意外删除了一些包。通过重新安装VS代码解决。