I have a very simple working setup:
Lib A Lib B
publish 1.0.0-SNAPSHOT -> Private Registry -> npm install
Keep in mind that A and B are on different machines (think jenkins cluster!).
During two releases the versions end with "-SNAPSHOT" and are updated on every build (A). Of course the depended libraries (B,...) should always use the newest version from the registry. Problem is, NPM will not refetch the same version.
Lib A Lib B
small change, rebuild:
publish 1.0.0-SNAPSHOT -> Private Registry !! npm install -f
npm cache clean
!! npm install -f
rm -rf node_modules
-> npm install
Idea: Disable cache for NPM globally
That would be okay because we a local npm proxy: "~/.npmrc":
force=true
cache-min=0
cache-max=0
But this does not work! Only removing the node_modules directory works. This is not a usable solution because the developer should not need to use "rm -rf node_modules && npm install".
With maven this setup works because we use the "-U" option. This forces maven to check if an updated SNAPSHOT version is available. NPM does not understand the concept of SNAPSHOT but at least is should ask the registry every time.
npm version 2.12.0
Private Registry: Sonatype Nexus™ 2.10.0-02