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博客

相关推荐
一只小风华~10 分钟前
JavaScript:数组常用操作方法的总结表格
前端·javascript·数据结构·vue.js·算法
程序媛李李李李李蕾31 分钟前
你不能直接用现成的吗?整个前端做笔记管理工具真是折腾人
javascript·vue.js·后端
The_era_achievs_hero1 小时前
UniappDay04
vue.js·微信小程序·uni-app
猫和老许2 小时前
Vue 3 拖拽排序功能优化实现:从原理到实战应用
前端·javascript·vue.js
DM今天肝到几点?2 小时前
【7.26-7.28胜算云AI日报:首个开源3D世界生成模型腾讯混元、微软预示 8 月 GPT-5 发布、Nemotron推理、商汤悟能、DM夺金】
人工智能·vscode·microsoft·3d·ai·chatgpt
sq8002 小时前
ag-grid-vue3 降级,支持低版本浏览器
前端·javascript·vue.js
兔年鸿运Q小Q2 小时前
html转word下载
javascript·vue.js·word
你这个年龄怎么睡得着的2 小时前
玩转vite性能优化
前端·vue.js·vite
华洛2 小时前
Agent应用落地,必不可少的三大辅助系统
前端·javascript·vue.js
江城开朗的豌豆2 小时前
Vue的双向绑定已经能精确追踪变化,为什么还要用虚拟DOM?揭秘背后的性能哲学!
前端·javascript·vue.js