Closed p0wl closed 10 years ago
What if you try node node_modules/.bin/component install
?
Different error message:
If i execute the command in cmd (or powershell) it is working.
@p0wl Are you sure about that? I am seeing the same error on windows, but I can only execute the command by hand within powershell, it error's with the same message about . not being a command when using cmd.
Powershell cs Cmd doesn't matter when grunt-exec issues the command, they both error for me.
(Funny enough I also ran into this when building noflo-ui-server :smile:)
What ended up working on on both platforms was a slight variation of @jharding's suggestion node node_modules/component/bin/component install
You should try using \ instead of / on Windows - then it is working for me. But this doesn't work on Unix - so I am doing a case differentiation which isn't a really nice solution...
Prepending node
command before node_modules/.....
worked for me, thanks @johlrich!
Also you can use path.resolve or path.relative
var path = require("path");
exec: {
bowerinstaller: path.relative("", "node_modules/.bin/bower-installer")+" -r --silent"
},
Could grunt-exec automatically perform path.relative
translation on the first whitespace-separated token in tasks? That way, Grunt "just works" on more operating systems.
It could do this.. but then it would break in other situations (ie if "node" were specified before the path). grunt-exec has no way of knowing what is a path and what is an executable or argument. This is up to the user.
I have the following command to execute using grunt (exec):
command: './node_modules/.bin/component install'
The grunt tasks fails with the following error:
If i execute the command in cmd (or powershell) it is working.
any idea? it doesn't matter if the command uses / oder \
Thanks in advance.