vscode离线安装插件

背景:项目工程使用内网,无法使用互联网直接安装,只能通过离线安装

1、vue语法高亮vetur插件

2、代码修改记录Gitlens插件

插件下载地址:Extensions for Visual Studio family of products | Visual Studio Marketplace

下载好插件,在vscode安装目录,

windows系统查询vscode安装目录命令

复制代码
where code

在bin目录下执行命令

复制代码
# xxx.visx 是插件包的名称加后缀
code --install-extension xxx.visx

遇到问题

1、安装成功,但是工程不起作用

原因:使用的vscode版本不支持当前插件,需要下载低版本的插件

2、插件没有下载按钮

方法一:f12,在面板console执行js代码

复制代码
    //--------------------------marketplace.visualstudio.com----download-------------------------------//
    let vsMarketDownloader = (function () {
        return {
            addDownloadBtn: function () {
                if (window.location.host.toUpperCase() !== 'MARKETPLACE.VISUALSTUDIO.COM') return false;
                let arr = window.location.href.split('?')[1].split('=')[1].split('.');
                let author = arr[0];
                let id = arr[1];
                var histories = document.querySelectorAll('tr.version-history-container-row');
                for (var i = 1; i < histories.length; i++) {
                    let version = histories[i].firstChild.textContent;
                    let a = document.createElement('a');
                    a.className = 'bowtie-icon bowtie-install';
                    a.style = 'margin-left: 1rem;'
                    a.href = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${author}/vsextensions/${id}/${version}/vspackage`;
                    histories[i].firstChild.appendChild(a);
                }
                return true;
            }
        }
    })();
    setTimeout(() => {
        vsMarketDownloader.addDownloadBtn();
    }, 1200);

方法二:在git下载GitLens离线插件安装 vscode(无download extension选项)_gitlens插件下载-CSDN博客

相关推荐
白云LDC18 小时前
Android Studio新建Vecter asset一直显示Loading icons(转圈圈)的解决办法
android·ide·android studio
An_s19 小时前
编辑器AI工具(vscode+claude)
ide·vscode·编辑器
千百元1 天前
VScode怎么切中文菜单
vscode
用户6688599847661 天前
Vue 3.0安装与使用
vue.js
secondyoung1 天前
VSCode设置显示空白字符
ide·vscode·编辑器
前端之虎陈随易1 天前
2年没用Nodejs了,Bun很香
linux·前端·javascript·vue.js·typescript
艺杯羹1 天前
全网首发!Claude Code 国内用法保姆级教程:API配置+VS Code插件,15分钟轻松上手
vscode·ai·ai编程·模型·claude code
Hotakus1 天前
【Hotakus‘s Nocturne】一个暗色 VS Code 主题,低对比度配色 + 语义高亮,看代码不累。
vscode·开源·开源软件
前端 贾公子1 天前
解决浏览器端 globalThis is not defined 报错
前端·javascript·vue.js
小风吹啊吹~1 天前
vscode的tunnel链接(Linux 服务器 + Windows 本地电脑版本)
服务器·vscode·microsoft·远程工作