Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What package version does @next specify for npm?

What version of package foo will this command install?

npm install foo@next 

The package.json and semver docs don't mention next.

like image 786
Dan Dascalescu Avatar asked Nov 15 '16 23:11

Dan Dascalescu


People also ask

What is @next in npm package?

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.

Which version of package is installed npm?

Use npm view [package-name] version to know the specific latest version of a package available on the npm registry. Use npm list [package-name] to know the specific latest version of an installed package.

What does * version mean in npm package dependency?

For example a dependency with a version of * would equate to any version that was greater than or equal to 0.0.0, while 1.* would allow versions greater than or equal to 1.0.0 and less than 2.0.0.

How do I update npm packages to a specific version?

To update a specific package, we need to run the npm update command followed by the package name. Sometimes, you want to update a package to the specific version in such cases you need to use npm install command by specifying a version number after the package name.


2 Answers

next is a version or tag published in your reference npm registry

npm install installs a package.

A package is:  ... d) a <name>@<version> that is published on the registry (see npm-registry) with (c) e) a <name>@<tag> (see npm-dist-tag) that points to (d) ... 

You can view the version that each dist-tag points to by running the following commands:

npm view <package_name> dist-tags npm dist-tags ls <package_name> 

e.g. for the react npm package:

npm view react dist-tags 

Output:

{   latest: '17.0.2',   next: '18.0.0-rc.0-next-3dc41d8a2-20211223',   experimental: '0.0.0-experimental-3dc41d8a2-20211223',   beta: '18.0.0-beta-24dd07bd2-20211208',   rc: '18.0.0-rc.0' } 

Source

like image 123
Diego Ferri Avatar answered Oct 13 '22 18:10

Diego Ferri


Next is tag. look at the below possible commands.

A tag can be used when installing packages as a reference to a version instead of using a specific version number:

npm install [<@scope>/]<name> npm install [<@scope>/]<name>@<tag> npm install [<@scope>/]<name>@<version> npm install [<@scope>/]<name>@<version range> 

How its added in package? See dist-tag

npm dist-tag add <pkg>@<version> [<tag>] npm dist-tag rm <pkg> <tag> npm dist-tag ls [<pkg>] 

Check - https://docs.npmjs.com/cli/dist-tag

like image 44
Venkat.R Avatar answered Oct 13 '22 17:10

Venkat.R