node_modules中.bin文件夹的用途是什么? [英] What is the purpose of .bin folder in node_modules?

查看:628
本文介绍了node_modules中.bin文件夹的用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Today one colleague explained me how to create nodejs projects and I notice that in ./node_modules there is an invisible folder named .bin. I must said that I discovered this after adding to the project "bootcamp" and "bower" tools. What's .bin purpose? What is it created for?

推荐答案

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

That is a folder where binaries (executables) from your node modules are located.

NPM网站状态


可执行文件在全局模式下,可执行文件在Unix上链接到
{prefix} / bin,在Windows上直接链接到{prefix}。

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

在本地模式下,可执行文件链接到./node_modules/.bin中,因此
可以使它们可用于通过npm运行的脚本。 (以
为例,当您运行npm
测试时,测试运行程序将处于路径中。)

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_modules中.bin文件夹的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆