npm 和 cpm


  1. npm(node package manager)是nodejs的包管理器,用于node插件管理(包括安装、卸载、管理依赖等)

  2. npm安装插件

     npm install xxx_name 
    
  3. 全局安装插件

     npm install xxx_name  -g
    
  4. 卸载插件:

     npm uninstall xxx_name
    
  5. 将包的名称及版本号放在dependencies里面。当NODE_ENV变量值为production时,npm install命令时,会自动安装xxx_name到node_modules目录中

     npm install xxx_name  --save
     npm install xxx_name  -S
    
  6. 将包的名称及版本号放在devDependencies里面。当NODE_ENV变量值为production时,npm install命令时,不会自动安装xxx_name到node_modules目录中

     npm install xxx_name  --save-dev
     npm install xxx_name  -D
    
  7. 安装cnpm

     npm install cnpm -g --registry=https://registry.npm.taobao.org
    
  8. 使用:cnpm install xxx_name


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM