node.js - node_modules 中 .bin 文件夹的用途是什么?

标签 node.js bower

今天一位同事向我解释了如何创建 nodejs 项目,我注意到在 ./node_modules 中有一个名为 .bin 的不可见文件夹。我必须说,我在添加到项目“bootcamp”和“bower”工具后发现了这一点。 .bin 的目的是什么?它是为了什么而创建的?

最佳答案

这是您的 Node 模块中的二进制文件(可执行文件)所在的文件夹。

NPM site states :

Executables When in global mode, executables are linked into {prefix}/bin on Unix, or directly into {prefix} on Windows.

When in local mode, executables are linked into ./node_modules/.bin so that they can be made available to scripts run through npm. (For example, so that a test runner will be in the path when you run npm test.)

关于node.js - node_modules 中 .bin 文件夹的用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25306168/

相关文章:

twitter-bootstrap - 在不接触 Bower 的情况下覆盖 Bootstrap 变量

javascript - 将谷歌地图 Api 添加到使用 Bower 和 Grunt 构建的项目中

asp.net - Bower 与 Visual Studio 发布

javascript - Expressjs/AngularJS : Error after implementing req-flash

javascript - 嗨,我在这里得到这个错误错误 : Cannot find module 'debug'

node.js - 如何编写可由 NodeJS 和 Aurelia 使用的 ES6 类\模块

node.js - 使用Vue CDN时如何使用mapGetters?

javascript - Grunt 不再实时重载

bower - 为什么安装时 bower 挂了?

javascript - Express.js,get 调用返回 500 错误