Reputation: 1452
I'm normally in java-land but for a few weeks I've received a wordpress site that uses gulp and I need to know some npm/nodejs to understand it.
I want to define a builder in eclipse that will build the output files from gulp automatically after each time I save my resource files (js/css). This requires me to point to an executable CLI program.
The thing I can't figure out is where do all these packages' CLIs get stored? It seems my local project has a node_modules directory AND my /usr/local/lib has a node_modules directory and I'm assuming one is for local plugins and the other is for global ones.
My question is when I saw "gulp" in a CLI in my project root directory, how does it know it should run an rpm plugin cli program and where does it find it?
Upvotes: 0
Views: 653
Reputation: 31
See https://docs.npmjs.com/files/folders:
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.)
The {prefix} config defaults to the location where node is installed. On most systems, this is /usr/local. On windows, this is the exact location of the node.exe binary. On Unix systems, it's one level up, since node is typically installed at {prefix}/bin/node rather than {prefix}/node.exe.
Upvotes: 1