美文网首页饥人谷技术博客
npm install --save app 与 npm ins

npm install --save app 与 npm ins

作者: 晓风残月1994 | 来源:发表于2017-11-06 16:30 被阅读112次

都是安装 app 包,但是前者会把 app 和版本信息写入 package.json 文件中的 dependencies 依赖字段里, 而后者会 写入到 devDependencies 开发依赖字段里。

  • "dependencies": These packages are required by your application in production.
    这是你的应用程序运行时所需要的。

  • "devDependencies": These packages are only needed for development and testing.
    这个字段中的 package 只是开发和测试中需要用到,项目开发完成后,执行时不依赖于这些。

另外(大小写,几个dash - ,请看仔细):
npm install --save app 也可以写成 npm install -S app
npm install --save-dev app 也可以写成 npm install -D app

相关文章

网友评论

    本文标题:npm install --save app 与 npm ins

    本文链接:https://www.haomeiwen.com/subject/slblmxtx.html