[JAVA] About npm install --save

Introduction

This post is about the --save option of the npm install command, but already

When installing packages with npm, I often see the option --save when searching the net. ex) When installing axios

$ npm install axios --save

I don't see it when installing globally with -g, but I tried to find out who it was.

About the npm install --save option

It seems that it will be registered in dependencies of package.json.

What makes me happy

When committing to git, the folder node_modules that installs the package is excluded by .gitignore. If you want to clone and build a different development environment from git, restore it based on package.json. Therefore, you can easily build the same package environment.

Conclusion: Do you need the --save option?

The --save option is not needed in the current environment. Since npm5.0.0 released on 2017-05-30, --save is added by default. Therefore, it is basically unnecessary now except in the old environment.

reference

https://yosuke-furukawa.hatenablog.com/entry/2017/05/30/090602 https://blog.npmjs.org/post/161081169345/v500 https://nodejs.org/ja/download/releases/

Recommended Posts

About npm install --save
Clogged with Express npm install
Error when npm install on Windows 7
About go get and go install from Go1.16
About =
Install the package with npm install / yarn add