npm 如何查看一个包的版本信息?(转载)
转载来源:https://blog.csdn.net/cvper/article/details/79543262
有了npm 我们能够简单的一段代码就下载我们需要的包,但是包是不断更新的,
所以我们要关注包的版本信息;
查看本地包的版本信息可以去配置文件直接查看。
例如: vue项目 在package.json、package-lock.json
假设现在我们已经成功下载了jquery,过了一段时间,我忘记了下载的jquery的版本信息,
这个时候,我们就需要查看本地下载的jquery版本信息,怎么做呢?
第一种方式:npm ls jquery 即可(查看本地安装的jQuery),下面我的本地没有安装jquery,
所以返回empty的结果;
第二种方式:npm ls jquery -g (查看全局安装的jquery)
现在,假设我们需要 jquery ,但是jquery现在有很多版本,我们如何通过npm查看呢?
要知道,现在的jquery包在npm服务器的上,我们使用下面的命令查看:
第一种方式:使用npm view jquery versions
这种方式可以查看npm服务器上所有的jquery版本信息;
第二种方式:使用npm view jquery version
这种方式只能查看jquery的最新的版本是哪一个;
第三种方式:使用npm info jquery
这种方式和第一种类似,也可以查看jquery所有的版本,
但是能查出更多的关于jquery的信息;
总结:上面我们了解了如何通过npm 来查看我们需要的包的版本信息,
既可以查看远端npm 服务器上的,也可以查看本地的;
相关文章
- 初探和实现websocket心跳重连(npm: websocket-heartbeat-js)
- VUE - 引入 npm 安装的模块 以及 uuid模块的使用
- 怎么写一个带 bin 的 npm 包
- [NPM + React] Prepare a Custom React Hook to be Published as an npm Package
- [NPM] Test npm packages locally in another project using npm link
- [NPM] Create a bash script to replace a complex npm script
- [NPM] Use custom config settings in your npm scripts
- [NPM] Run npm scripts in parallel
- [NPM] Run npm scripts in series
- [NPM] Set default values for package.json using npm set
- [NPM] npm check to update the dependencies
- [NPM] Create a new project using the npm init <initializer> command
- [NPM] Publish npm packages using npm publish
- [NPM] Create a node script to replace a complex npm script
- [NPM] List available npm scripts and support tab completion
- [NPM] Run npm scripts with git hooks
- [FE] nvm-windows: Microsoft/NPM/Google 推荐 Windows 的 Node.js 版本管理器
- 使用 npm 命令查看某个 npm 开发包明细
- yarn start 和 npm start 的区别
- nodejs里npx介绍和使用:npm 从5.2版开始,增加了 npx 命令
- cordova蓝牙插件 npm ERR! enoent This is related to npm not being able to find a file.
- 当你运行npm run命令时,会发生什么
- npm run dev 启动错误:Module build failed: Error: No PostCSS Config found in:xxxxxxxxxxxxxx
- Node.js:使用nrm来管理npm源
- 【Deepin 20系统】Jupyter notebook解决ValueError: Please install Node.js and npm before continuing installa
- 如何解决npm run serve运行vue项目时,出现报错:Error: error:0308010C:digital envelope routines::unsupported
- npm/yarn ---- 全局依赖安装路径的查询和修改