简体   繁体   中英

Why does Node use node_modules instead of .node_modules?

I was always under the impression that settings and "meta information" should be stored in a dotfile (or in this case, a dot-directory). Why didn't Node use a local .node_modules directory?

Is there a technical reason? If not, is there anything written about this design decision from the team?

The "." implies a hidden folder, which the node_modules aren't. Node modules need to be used throughout the application, sometimes by the user (such as importing minified javascript files for Angular) and therefore should not be hidden files.

Be sure not to include them in your git commits by creating a .gitignore file and adding node_modules to it!

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM