简体   繁体   中英

npm package from private github repo, install vs update (package.json)

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)

您可以尝试像这样在package.json指定分支名称吗

"my-tasks": "git+ssh://git@github.com:Flutterbee/my-tasks.git#master" 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM