2019独角兽企业重金招聘Python工程师标准>>>

首先,需要明白:

使用npm i node_module –save自动更新dependencies字段值;

使用npm i node_module –save-dev自动更新devDependencies字段值;

如下图:

[root@~/wade/git/node-lessons/test]# npm init
[root@~/wade/git/node-lessons/test]# npm install express --save
[root@~/wade/git/node-lessons/test]# npm install jslint --save-dev
[root@~/wade/git/node-lessons/test]# cat package.json
{"name": "test","version": "1.0.0","description": "test","main": "main.js","keywords": ["test"],"author": "wade","license": "MIT","dependencies": {"express": "^4.10.1"},"devDependencies": {"jslint": "^0.6.5"}
}

那么这两个字段究竟有何区别?

  • npm的package.json中文文档

  • npm-config

  • package.json 里的 devDependencies 是什么意思?

  • option to not install devDependencies

  • --save-dev官方pull记录 Added --save-dev and --save-optional to `npm install`

  • 请教一下nodejs package.json的依赖关系定义

  • How do you install “development only” NPM modules for Node.js (package.json)?

总结以上的记录说下这两个字段的区别(个人理解):

  • devDependencies只用于开发阶段完成集成测试等功能模块依赖;

  • 对于生产环境只需要使用npm install –production依赖必须的模块即可;

    参考:http://blog.csdn.net/billfeller/article/details/40712417

转载于:https://my.oschina.net/u/1260221/blog/897734

dependencies与devDependencies之间的区别相关推荐

  1. dependencies与devDependencies区别,以及peerDependencies的作用,npm2和npm3区别

    作者:报道出了偏差 链接:https://www.zhihu.com/question/310545060/answer/584122572 来源:知乎 著作权归作者所有.商业转载请联系作者获得授权, ...

  2. dependencies 和 devDependencies 区别

    问:dependencies 和 devDependencies 区别 依赖就是一定会用到的东西,开发依赖就是在开发中用到的,发布到线上不一定会用到的 问:会有这种场景吗?能举个例子吗 比如用我用一个 ...

  3. 一文看懂npm、yarn、pnpm之间的区别

    原文:Understanding differences between npm, yarn and pnpm 作者:Alex Kras 翻译:雁惊寒 本文作者对比了当前主流的包管理工具npm.yar ...

  4. rake db:migrate db:reset和db:schema:load之间的区别

    本文翻译自:Difference between rake db:migrate db:reset and db:schema:load The difference between rake db: ...

  5. cookies和缓存的区别_Cookies和缓存之间的区别

    cookies和缓存的区别 Here you will learn about difference between cookies and cache i.e. cookies vs cache. ...

  6. FPGA与ASIC:它们之间的区别以及使用哪一种?

    FPGA与ASIC:它们之间的区别以及使用哪一种? FPGA Vs ASIC: Differences Between Them And Which One To Use? VL82C486 Sing ...

  7. Python 应用领域以及版本之间的区别

    Python 应用领域以及版本之间的区别 一.Python应用领域 Python+人工智能,给你更多研究方向选择! 企业级综合实战项目,集六大前沿技术为一体 二. Python 2与Python 3的 ...

  8. java中separator_java - File.separator和路径中的斜杠之间的区别

    java - File.separator和路径中的斜杠之间的区别 在Java Path-String中使用/和普通的File.separator有什么区别? 与双反斜杠相比,/平台独立似乎不是原因, ...

  9. 机器学习、数据科学、人工智能、深度学习和统计学之间的区别!

    ↑↑↑关注后"星标"Datawhale 每日干货 & 每月组队学习,不错过 Datawhale干货 作者:Vincent Granville,来源:机器之心 在这篇文章中, ...

最新文章

  1. c语言实现堆Stack(附完整源码)
  2. 向linux内核加入系统调用新老内核比較
  3. C++中之a[5](栈区)和int a=new int[5](堆区)有什么区别
  4. C语言: ---windows下VS Debug调试
  5. 《R语言编程艺术》——1.4 R语言中一些重要的数据结构
  6. python语言入门-Python语言入门.pdf
  7. GDB调试字符数组时指针和数组区别的体现
  8. 【设计模式】适配器模式
  9. 菜鸟教程 Java 学习笔记 (基础教程)
  10. Confluence 插入符号和特殊字符
  11. 程序员值得提升的沟通小技巧!
  12. 《RAFT-Stereo:Multilevel Recurrent Field Transforms for Stereo Matching》论文笔记
  13. 摄像头各参数的意义_如何选择摄像头,需要考虑那些参数
  14. 零钱模拟器微信小程序源码下载
  15. http 返回码 405 解决方案之一
  16. 计算机硬盘清理,Win7电脑的磁盘满了怎么办?最简单的清理方法教给你!
  17. OpenCL: 从零开始学习OpenCL开发
  18. SPICE鼠标报点率降低问题分析
  19. elastica安装
  20. 汽车保养app 功能需求

热门文章

  1. 一行Java代码实现获取上传文件的后缀名
  2. BJUI使用ajax异步表单提交时后台action要加@ResponseBody
  3. 从0-1教你利用服务器做属于自己的个人博客
  4. 秒拍副总裁陈太锋:如何通过数据分析提升有效播放量
  5. 在大数据时代,每家公司都要有大数据部门吗?
  6. Oracle 11G安装时遇到了net.bridge.bridge-nf-call-ip6tables错误
  7. Google API 设计指南 - 前言
  8. 程序语言(编程语言)汇总大全
  9. 如何确定Oracle是32 Bit(位)的还是64 Bit(位)的?
  10. Intellectual Property Essentials for Start-Ups