npm 会将模块安装在 Macbook 文件系统中的什么位置?

where would npm install the modules in Macbook file system?

我刚刚使用 npm install underscore 安装了模块 underscore js。我想知道 NPM 如何以及在何处存储该模块,以便我可以将该模块导入我的 .js 文件中。

使用不带 -g 标志的 npm install 将在 node_modules

下的当前目录中安装模块

使用npm install -g,它将安装在计算机上的以下地址(MAC)

/usr/local/lib/node_modules/