When trying to install a package it doesn't install the latest version of dependency which version defined as a tag in package.json:
"dependencies": { "mcs-common-test": "SNAPSHOT" }
Steps to Reproduce We have package "molina_ms" with dependency "mcs-common-test"
- Publish "mcs-common-test" to private registry (Nexus 2) as version 1.0.0-SNAPSHOT.1 with tag "SNAPSHOT"
$ npm publish --tag SNAPSHOT
npm notice
npm notice mcs-common-test@1.0.0-SNAPSHOT.1
npm notice === Tarball Contents ===
npm notice 32.3kB index.js
npm notice 620B package.json
npm notice 179B readme.md
npm notice === Tarball Details ===
npm notice name: mcs-common-test
npm notice version: 1.0.0-SNAPSHOT.1
npm notice package size: 8.4 kB
npm notice unpacked size: 33.1 kB
npm notice shasum: bca464e6cd4db1e1358eb8d5cc0fbe6abb4b11b5
npm notice integrity: sha512-6lvGfgwUzKrwU[...]bFMAWtqSw9N5A==
npm notice total files: 3
npm notice
- Install package "molina_ms" with following configuration in package.json: "dependencies": { "mcs-common-test": "SNAPSHOT" } Output:
npm install npm notice created a lockfile as package-lock.json. You should commit this file. added 1 package from 1 contributor in 1.408s
In package-lock.json we have:
"dependencies": { "mcs-common-test": { "version": "1.0.0-SNAPSHOT.1"
Looks good.
3.Then we bump a version of "mcs-common-test" and publish it:
$ npm version prerelease
v1.0.0-SNAPSHOT.3
npm publish --tag SNAPSHOT
npm notice
npm notice mcs-common-test@1.0.0-SNAPSHOT.3
npm notice === Tarball Contents ===
npm notice 32.3kB index.js
npm notice 620B package.json
npm notice 179B readme.md
npm notice === Tarball Details ===
npm notice name: mcs-common-test
npm notice version: 1.0.0-SNAPSHOT.3
npm notice package size: 8.4 kB
npm notice unpacked size: 33.1 kB
npm notice shasum: a6f4af8bd35fcd9893faea801e6384cc5dab4b3e
npm notice integrity: sha512-0S3XHyoOSUKU9[...]NyB1PQyV0baEw==
npm notice total files: 3
npm notice
mcs-common-test@1.0.0-SNAPSHOT.3
- Trying to install "molina_ms" package:
npm install
up to date in 0.809s
The result - no changes. The new version of "mcs-common-test" wasn't downloaded
Expected Behavior The latest version of dependency mcs-common-test@1.0.0-SNAPSHOT.3 should be installed
Why doesn't npm download the latest version with tag "SNAPSHOT"?