If you use an npm script to run gulp, and you make your verison of gulp a
devDependency, npm will add ./node_modules/.bin to the path and run your
local copy.
When you use a package as a dependency that has a "bin" script(s), they are
sym-linked into ./node_modules/.bin for this kind of use case.
node_modules/.bin/gulp -> node_modules/gulp/bin/gulp.js
If you set up a script like this in package.json:
scripts: {
build: "gulp"
}
This command runs your copy of gulp on your package:
npm run build
There are lots of uses, like defining a prepublish script to test/validate
before publishing a package to the registry.
See: https://www.npmjs.org/doc/misc/npm-scripts.html#path
On Saturday, June 21, 2014 3:11:40 PM UTC-4, Gary Katsevman wrote:
>
> I believe the global install is only so that you have the gulp cli
> command available. All the actual tasks and what not are installed locally
> and the global gulp just finds the appropriate local tasks and runs them.
>
>
> Gary Katsevman
> gkatsev.com
>
>
> On Fri, Jun 20, 2014 at 6:49 PM, Jari Pennanen <[email protected]
> <javascript:>> wrote:
>
>> Hello,
>>
>> I haven't used nodejs a lot, but first thing I noticed when using gulp is
>> that it requires local installation for all projects. I understand, it's
>> good to have same version of gulp as dependency for project, so that other
>> people using gulp on the project use same version.
>>
>> But if my project has gulp as dependency to latest version, and I have
>> globally installed latest version, why it still requires local version?
>>
>> The point is, the dependency for specific gulp version should be
>> *required*, and if it's met (using global package) why is local
>> installation required?
>>
>> I hope I am being clear.
>>
>> Thanks.
>>
>>
>> --
>> Job board: http://jobs.nodejs.org/
>> New group rules:
>> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
>> Old group rules:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "nodejs" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/nodejs/eec6ce58-3a72-44a3-9368-53f817b10170%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/nodejs/eec6ce58-3a72-44a3-9368-53f817b10170%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/3efe61d7-4dea-489b-8af4-dbfa29221cef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.