I am creating a node module with devDependencies that should be installed globally, such as jasmine-nodes and What I need to do is jashint I want to be able to refer to my binaries to run tests, lint, etc in my makefile / npm scripts section. In other words, I do not want them programming (programming).
I am still confused about this:
1) My first approach was to believe that these modules will be installed globally, in the documents of my module Explain and reference their binaries as globally - that is, they should be available globally, collision with this piece of advice.
Ensure that you have installed globally Gone to Binaries Avoid referencing. Instead, point it to the local node_module, which is a hidden one. Bin establishes binary in the directory. Make sure the module (in this case "Mocha") is in your package. Jason is under the devDependencies, so that you keep binary while installing NPM.
(taken from)
This usually seems right, because the above setup is relatively weak.
2) My next approach was clearly to include those modules in devDependencies (although they are still globally installed on their system (and most likely users' and contributors 'With systems too)). It ensures that when necessary, there are suitable versions of binaries and I can now reference them through
node_modules / .bin / .
Although I am in conflict with this part
(taken from)
without paying attention to it
, I think that install npm will now notify anything (no network activity is displayed) for the globally installed module.
My questions:
- Is the local version of the module installed on the global level (which are mentioned in devDependencies) are just snapshots of global denominations, which are
Npm install
- is 2) is the right way to go about doing this? Or is there any other practice I am missing?
Take my private on this, which node. JS is definitely different from general practice, but I believe this is an overall best approach. It is detailed in its own blog post (Disclaimer about self-promotion, more often).
It basically boils down to:
- Do not use npm -g at any time Never install global modules.
- Instead, adjust your PATH to include
projectDir / node_modules / .bin instead of
No comments:
Post a Comment