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

相关推荐
小菜全2 小时前
《React vs Vue:选择适合你的前端框架》
vue.js·react.js·前端框架
真的想不出名儿4 小时前
vue项目引入字体
前端·javascript·vue.js
笨蛋不要掉眼泪5 小时前
SpringBoot项目Excel成绩录入功能详解:从文件上传到数据入库的全流程解析
java·vue.js·spring boot·后端·spring·excel
坠金6 小时前
pycharm中进入/激活/退出虚拟环境
ide·pycharm
MediaTea8 小时前
Jupyter Notebook:基于 Web 的交互式编程环境
前端·ide·人工智能·python·jupyter
oscar9998 小时前
Visual Studio Code 的 AI 插件汇总
ide·vscode·ai
奶糖 肥晨8 小时前
Uniapp 开发中遭遇「可选链赋值」语法陷阱:一次编译错误排查实录
javascript·vue.js·uni-app
fakerth8 小时前
【Cursor/Vscode】SSH免密登录
ide·vscode·ssh
belldeep8 小时前
python:Django 和 Vue.js 技术栈解析
vue.js·python·django
正义的大古9 小时前
OpenLayers地图交互 -- 章节十七:键盘缩放交互详解
javascript·vue.js·openlayers