简体   繁体   English

为什么在package.json中作为devDependencies咕gr咕

[英]Why grunt as devDependencies inside package.json

I'm new with grunt, I started learning it ten minutes ago and I was wondering why grunt must be listed in the package.json as dependencies. 我是grunt的新手,十分钟前开始学习它,我想知道为什么必须在package.json中将grunt作为依赖项列出。 This means that when someone will install my module for node, for example, npm will install to him also grunt. 这意味着,例如,当有人为节点安装我的模块时,npm也会对他安装。 But I actually need grunt just to minify stuff and push them to my git repo and it isn't needed to run actually the node script. 但是我实际上只需要咕unt咕to,以使内容最小化并将其推送到我的git repo中,而实际上不需要运行节点脚本。

Did I miss something? 我错过了什么?

UPDATE: Now that I know how to handle grunt I can say that I don't like it so much. 更新:现在我知道如何应付咕gr声了,我可以说我不太喜欢它。 I find grunt too tied with npm. 我发现咕unt声与npm息息相关。 This post explain perfectly my feelings about this task runner: Using a task runner without package.json 这篇文章完美地解释了我对这个任务运行程序的感受: 使用不带package.json的任务运行程序

dev Dependencies are only installed when doing npm install in the root of the package. dev依赖项仅在软件包根目录中执行npm installnpm install When someone installs your package, only the dependencies are installed. 当有人安装您的软件包时,仅安装dependencies

So grunt in devDependencies is exactly what you want, you need grunt when dev eloping your package. 所以devDependencies正是您所需要的, 开发人员开发软件包时需要格外认真。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在package.json的devdependencies中包含npm可以吗? - Is it okay to include npm in devdependencies in package.json? 创建列出了所有devDependencies的package.json - Creating a package.json with all devDependencies listed npm - 不想在 package.json 中的 devDependencies 上列出包 - npm - Don't Want To List Package On devDependencies Inside package.json 如何在 package.json 中只安装与 babel 相关的 devDependencies? - How to install only babel related devDependencies in package.json? package.json —在删除package.json之后,如何在package.json文件的'dependencies'和'devDependencies'中添加已安装的软件包? - package.json — How to add already installed packages in 'dependencies' and 'devDependencies' in package.json file after delete package.json? 使用grunt依赖项更新package.json文件 - Update package.json file with grunt dependencies GRUNT安装时没有package.json - GRUNT installs without package.json 在package.json中读取package.json版本 - Read package.json version inside package.json 如何防止为 Node.js (package.json) 安装“devDependencies”NPM 模块? - How do you prevent install of "devDependencies" NPM modules for Node.js (package.json)? npm package.json 文件中的依赖项、devDependencies 和 peerDependencies 有什么区别? - What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM