ChatGPT解决这个技术问题 Extra ChatGPT

How to list all versions of an npm module?

In order to see all the versions of a node module [webpack], I have executed below command in windows command prompt

npm view webpack versions

This command only displays first 100 versions and later displays "331 more" text.

How will I be able to list all versions?

See here for listing all node modules.stackoverflow.com/questions/13981938/…
This npm ls --depth=0 will list all local modules as name@version. `
Or globals: npm -g ls --depth=0.
Possible duplicate of npm view get more items

S
Sumeet Kumar Yadav

Usually I do this if I want to see all versions

npm view webpack versions --json

Leaving off the --json flag formats it a bit nicer on my machine.
@Niek.. depends .. do you want incomplete for long lists, or json which gives you all.
The best answer!
d
danday74

This is pretty much the same but won't list alpha or beta releases

npm show webpack@* version

what is the difference between npm show npm view and npm info ?
@AkinHwan Nothing. They are all aliases of the same thing
Yeah but requires shell-escaping. It should have been instead: npm show 'webpack@*' version
This prints versions indefinitely, even alpha versions, not sure why but maybe it's that wildcard.
r
russiansummer

with yarn its just yarn info react-dnd versions, you can leave versions off for a lot of other info


k
kamula

you can view the available versions of any package using npm show <package_name> versions

for webpack use npm show webpack versions