Say I have a dependency in my package.json, like:
"my_dependency": "git+https://<github repo>#<old commit hash>"
If I delete my package-lock and node_modules, and do an
npm install, it works fine.
However, if I then push an update to my github repo that is
my_dependency, I want to use the latest commit in my project. I go to github and fetch the commit hash
<new commit hash>, then I edit my package.json file like so:
"my_dependency": "git+https://<github repo>#<new commit hash>"
Without deleting the current node_modules and package-lock, I run
npm install, but when I look into my node modules or package-lock, the previous commit version remains.
Is this the incorrect approach? Apart from using the npm registry to manage my private packages, what can you recommend I do to overcome this problem?