Package.json Git URLs as Dependencies

basic information
npm version 5.6.0
yarn version 1.8.0
node version 8.9.4
the dependencies section of package.json is as follows

"dependencies": {
    "baz": "git+http://foo.com/bar/baz.git"
},

problem description
there is no problem with the installation package, but there are some problems with the update. If I make new changes to this baz.git and submit them, I need to update them.
this is a case-by-case discussion
case 1 using packages initially installed by yarn

yarn upgrade baz

can be updated but will get a warning
Downloading the git repo over HTTP without a commit hash

case 2 use the package initially installed by npm

npm update baz

nothing happened, no success message, no failure message, no warning, most afraid of the sudden silence of the air
Open the directory of the baz package corresponding to the directory under node_modules and see that nothing has happened and has not been updated

my efforts
read
Git URLs as Dependencies
unfortunately it was not solved because the last sentence of the article says

.
If neither-sharp < commit-ish > or-sharpsemver: < semver > is specified, then master is used.

and the git of my baz package has only one master branch. So there"s nothing wrong with it

requested help
for case 1, how to correctly operate / configure git without generating this warning
for case 2, how to correctly update the package


node-v
10.16.3
npm-v
6.9.0
there is no problem with you


Brother, your problem may be caused by cyclic installation, that is, bar is also used in the package.json in your bar package. I also recently set up a component library. I don't know who is a little naughty. It caused this problem.

Menu