What exactly does next mean in package.json dependencies?
"dependencies": {
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-router-dom": "next"
}
The dependencies value is used to specify any other modules that a given module (represented by the package. json ) requires to work. When you run npm install from the root folder of a given module, it will install any modules listed in that dependencies object.
json just lists dependencies in alphabetical order by default, so I don't think it matters. You usually won't be manually adding the dependencies to your file, rather you'll be instructing npm to save packages as dependencies when you install them.
Using a caret (^) sign means that we can accept minor releases and patch releases, but not a major release when updating our package.
Using tilde ( ~ ) gives you bug fix releases and caret ( ^ ) gives you backwards-compatible new functionality as well. The problem is old versions usually don't receive bug fixes that much, so npm uses caret ( ^ ) as the default for --save .
The next tag is used by some projects to identify the upcoming version.By default, other than latest, no tag has any special significance to npm itself.
NPM Documentation
Specifically, and according to the documentation I found this helpful:
By default, the latest tag is used by npm to identify the current version of a package, and npm install (without any @ or @ specifier) installs the latest tag. Typically, projects only use the "latest" tag for stable release versions, and use other tags for unstable versions such as prereleases.
The next tag is used by some projects to identify the upcoming version.
By default, other than latest, no tag has any special significance to npm itself.
So, for instance, I had some issues related to npm itself generating npm ERR! Error: EACCES: permission denied errors on package installations, that I first corrected by reverting to an earlier version of npm (from 5.4.0):
npm install -g [email protected]
But npm is also one of those packages that does use the "next" tag in their distribution, so to take advantage of that in the newest but not officially "stable version", you could also run:
npm install -g npm@next
Which installed 5.5.1
Running: npm show npm versions --json
shows the following version history to give an idea what exactly was installed:
[ ...
"5.3.0",
"5.4.0",
"5.4.1",
"5.4.2",
"5.5.0",
"5.5.1"
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With