How to make NPM always update the last comite in the master?

1

I have a local repository (gitlab) with several components, I am pointing in package.json each component directly to this repository. Here is an example:

"dependencies": {
    "XX-alert": "git+http://git.domain.com/XX-platform/XX-alert.git",
    ...
}

I would like every time a developer makes a push to master anyone on the network making a npm update could get this update.

At this point in time for this to work I need to re-add the package:

npm install git+http://git.domain.com/XX-platform/XX-alert.git --save

Thank you.

    
asked by anonymous 12.04.2016 / 19:17

2 answers

1

If you know which dependency has been updated, you can run npm update <pkg> that it will update if you do not know which dependency has been updated, so I suggest you remove the node_modules folder with rm -rf node_modules and rotate npm install again.

    
12.04.2016 / 19:45
2

Bruno, a good practice is not to version this in Git, when a dev does the clone it downloads the packages and when you update, you have to put this process in Gulp build automation can help you to automate this tasks . The only thing you would versionaria would be the json file with the package relation, hence just give the npm update command to update the packages.

    
01.07.2016 / 02:04