I know my project's dependencies are installed under node_modules directory. But when I do require('lodash'), how does Node know which file to load? "How does Node know which file to read when loading a module?" Module loading works in two phase…
许多包有一个或多个可执行文件(executable),他们希望直接导入到全局路径里面,这样可以直接使用,npm很容易达到这点, A lot of packages have one or more executable files that they'd like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executa…