栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

npm ERR! command git ls-remote ssh://git@github.com/hyj1991/v8-profiler-next.git

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

npm ERR! command git ls-remote ssh://git@github.com/hyj1991/v8-profiler-next.git

npm 安装 v8-profiler-next时报错

v8-profiler-next是一个用于剖析nodejs性能的插件,可获取cpu性能堆栈,采集内存快照,官方版本是 node-profiler,但是无法安装,并且似乎无人维护,因此使用v8-profiler-next

报错内容:
npm ERR! code 128
npm ERR! command failed
npm ERR! command git ls-remote ssh://git@github.com/hyj1991/v8-profiler-next.git

解决方案
  • 问题1. . 我使用的是https协议从github下载安装的库,并没有配置ssh相应的key,而在gitlab-ci中使用了ssh协议去下载,那么应该将ssh协议改为https协议:
    可以在执行npm install指令前,执行以下指令:

    将url中的字符串进行替换
    git config --global url.“https://”.insteadOf ssh://git@

    会将 ssh://git@github.com 替换成 https://github.com,就变成http协议下载了;

  • 问题2. 国内访问github有时候比较慢,所以可以换成淘宝镜像进行下载
    再执行一个指令:

    git config --global url.“github.com.cnpmjs.org”.insteadOf github.com

    会将 https://github.com 替换成 https://github.com.cnpmjs.orj,相当于是从淘宝的github镜像进行下载了;满速起飞

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/323715.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号