Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to npm install and force latest version (permanently)?

I am deploying a private npm module for internal use at our company. Since the module is handled internally, we can trust version bumps etc.

How can I install the module in various projects so that the latest version of the module will always be installed with every single npm install, so that I don't have to go through a bunch of projects and update the version inside each package.json every time we deploy?

Please note that this should only be for selected packages, not all packages - i.e. only those hosted on our private server.

like image 895
john maccarthy Avatar asked Jan 18 '18 12:01

john maccarthy


1 Answers

Use "*" as your version in your package.json file. For example:

"dependencies": {
 "my-awesome-repo": "*"
}

Upon npm install this will automatically install the latest version for "my-awesome-repo" that is availabile on npm.

like image 135
binarymax Avatar answered Oct 18 '22 22:10

binarymax