7*4 2012-06-10 20:36 采纳率: 50%
浏览 1038
已采纳

查找已安装 npm 软件包的版本

How to find the version of an installed node.js/npm package?

This prints the version of npm itself:

npm -v <package-name>

This prints a cryptic error:

npm version <package-name>

This prints the package version on the registry (i.e. the latest version available):

npm view <package-name> version

How do I get the installed version?

转载于:https://stackoverflow.com/questions/10972176/find-the-version-of-an-installed-npm-package

  • 写回答

20条回答 默认 最新

  • from.. 2012-06-11 19:13
    关注

    npm list for local packages or npm list -g for globally installed packages.

    You can find the version of a specific package by passing its name as an argument. For example, npm list grunt will result in:

    projectName@projectVersion /path/to/project/folder
    └── grunt@0.4.1
    

    Alternatively, you can just run npm list without passing a package name as an argument to see the versions of all your packages:

    ├─┬ cli-color@0.1.6 
    │ └── es5-ext@0.7.1 
    ├── coffee-script@1.3.3 
    ├── less@1.3.0 
    ├─┬ sentry@0.1.2 
    │ ├── file@0.2.1 
    │ └── underscore@1.3.3 
    └── uglify-js@1.2.6 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(19条)

报告相同问题?

悬赏问题

  • ¥15 vc6.0中想运行代码的时候总是提示无法打开文件是怎么回事
  • ¥25 关于##爬虫##的问题,如何解决?:
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题