从私人github回购npm包,安装vs更新(package.json) [英] npm package from private github repo, install vs update (package.json)

查看:114
本文介绍了从私人github回购npm包,安装vs更新(package.json)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到这个问题了 npm-install-vs-update-whats我的问题是使用安装与更新私人github回购使用 git +



我有一个专门用于grunt的私人github回购。这个回购得到频繁的更新。我使用 git + ssh url来安装此回购库,如此处所述 npm install git remote url



安装时一切正常。更新软件包时出现问题。根据我的理解和上面提到的问题,在执行 npm install 时,npm会将软件包更新为最新版本,但这似乎不适用于从github安装的软件包。我不得不使用 npm update 来获取最新版本。我不介意使用 npm update ,但我观察到它比 npm install 慢。任何人都可以把他们的想法为什么这可能会发生。



我的package.json如下所示:

  {
name:My Project,
version:1.0.0,
dependencies:{
grunt:^ 0.4.5,
//相关软件包
my-tasks:git + ssh://git@github.com:Flutterbee / my-tasks.git
}
}

PS:使用npm 3.3.3(如果这有所不同)

解决方案

你可以尝试在package.json中指定分支名称,例如:
my-tasks:git + ssh:// git @ github .com:Flutterbee / my-tasks.git#master


I have already seen this question npm-install-vs-update-whats-the-difference

My question is around using install vs update for private github repo using git+ urls.

I have a private github repo which is used in the grunt. This repo receives frequent updates. I installed this repo using git+ssh url as mentioned here npm install git remote url

Everything works fine when installing. Problem comes when updating the package. As per my understanding and question mentioned above, npm updates the package to latest version when doing npm install but this doesnt seem to be case with package installed from github. I had to use npm update to get the latest version. I dont mind using npm update but I have observed that its slow compared to npm install. Can anyone put their thoughts why this might be happening.

My package.json looks like following

{
  "name": "My Project",
  "version": "1.0.0",
  "dependencies": {
    "grunt": "^0.4.5",
    //Relevent package
    "my-tasks": "git+ssh://git@github.com:Flutterbee/my-tasks.git" 
  }
}

PS : Using npm 3.3.3 (if that makes difference)

解决方案

can you try with specifying the branch name with in your package.json like this "my-tasks": "git+ssh://git@github.com:Flutterbee/my-tasks.git#master"

这篇关于从私人github回购npm包,安装vs更新(package.json)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆