-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local Npm module <> not found. Is it installed? #232
Comments
When using plugins inside a project's gruntfile, npm module plugins loaded via grunt.loadNpmTasks must be installed locally (in Does that help? |
Yes, it did. idly annoying that they're not put there when one installs them locally, but that's clearly an npm (or maybe my system...) issue. I really like this system, btw. Only been using it since Thursday, and already started figuring out how it can be used in some very nice ways. =) |
Yeah, I don't really want some automated process modifying the gruntfile, so you'll have to add them yourself! |
Why is it required that one should install modules locally? Isn't it possible that there might be several projects which use some module like grunt-less mutually? |
Afaik it is not required per se if your provide the correct path in grunt.loadNpmTasks.
|
Yes, I am aware of that. But isn't that a little bit verbose? All I want is Also, I noticed that there is a function called |
Npm doesn't provide a mechanism for loading globally-installed modules. Which is good, because you want them to be installed local to your project, anyways. Imagine a scenario where project A requires If you only worked on one project, ever, having everything installed globally would work... but the instant you start to work on multiple projects, it just doesn't scale. So install your project's dependencies locally, and you won't ever run into this problem. And FWIW, even though you install grunt globally, as of |
Ah, now I understand your intention. I thought npm would provide multiple version support like gem in ruby land. Maybe something like the bundler of ruby will help? Looking forward to your |
@dotnil many people think Npm should handle the multiple version support like gems do, but it doesn't. I'm not sure why, tbh. |
I'm sure many others will end up with this problem. If you don't have a |
👎 I find this requirement superficial and restrictive. If I want to have multiple Gruntfiles in nested modules, there's no reason why grunt can't look up the folder and see my tasks in one central location. I have a few dozen modules in my project all of which reuse parent model node_modules folder so that I don't have to have same dependencies installed over and over again everywhere. Trying to setup per module grunt file is proving to be a giant pain because of this "opinionated" restriction. |
Found that you can also do this... it's more concise than
|
@alexgorbatchev cant't agree anymore. |
I think |
I needed to load modules from inside of modules, so I hacked on @sindresorhus' lovely load-grunt-tasks, and made load-grunt-subtasks. I believe it would cover most of the use cases people were looking for here |
@patrickkettner if you specify dependency plugins as https://github.com/gruntjs/grunt-contrib/blob/master/package.json#L36-L63 |
@cowboy thanks! I am not sure it applies in my exact case. I have project X that has arbitrary projects foo, bar, and baz, all of which are also used in project Y.
Where as Y may be structured like
I wanted a way to share the grunt plugins of |
Yeah, your use-case is pretty non-standard. |
yep, thanks a ton for reaching out |
So if I load a module in grunt, and that module has dependencies, then they won't be loaded? This seems like a pretty broken system, why not just use require? |
Hi @cowboy,
Simply, executing, from the project root: $ grunt -gruntfile "configs/Gruntfile.js" fails. Amazing. Is this a way to force people place the "Gruntfile.js" beside "package.json" ? |
So the implication is you can't mix a global install of some modules and others locally without explicitly specifying. That wasn't intuitive to me at least.... |
@webgefrickel it only works with loadTasks instead of loadNpmTasks: |
I know this is old, but, anyone just finding this like I did, use load-grunt-tasks as mentioned above, with the requireResolution option set to true:
|
So, I've been playing around with grunt. At work everything went splendid, but now that I'm trying to run two of the npm tasks (grunt-shell and grunt-contrib), I'm running into an issue.
When I run grunt, it pops up 'Local Npm module "grunt-shell" not found. Is it installed? Local Npm module "grunt-contrib" not found. Is it installed?'. Both are, both globally with npm and locally with npm, at least I see them when I run npm list both globally and locally.
The other tasks are working fine, and the file is reported to be "lint free".
npm 1.1.25
node 0.6.18
nvm to controll version
Grunt-contrib 0.0.7
grunt-shell 0.1.1
grunt is installed globally, the two tasks are installed both globally and locally.
which grunt-shell/contrib gives: /home/marie/nvm/v0.6.18/bin/grunt-*
So, do you have any idea on what might be going wrong?
The text was updated successfully, but these errors were encountered: