当我们在用npm安装插件或者模块时,常常用到npm install --save -dev xxx的方法,这种方式安装,会将这个插件写到package.json文件夹中的devDependencies字段当中,这种方式适用于开发环境;而使用--save的方式,则将其写到dependencies的字段当中,这种方式则适用于生产环境。
当我们在用npm安装插件或者模块时,常常用到npm install --save -dev xxx的方法,这种方式安装,会将这个插件写到package.json文件夹中的devDependencies字段当中,这种方式适用于开发环境;而使用--save的方式,则将其写到dependencies的字段当中,这种方式则适用于生产环境。
本文标题:npm install --save-dev xxx 和 n
本文链接:https://www.haomeiwen.com/subject/kxosextx.html
网友评论