Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Issue with windows #138

Closed
ForbesLindesay opened this issue Nov 6, 2012 · 7 comments
Closed

Issue with windows #138

ForbesLindesay opened this issue Nov 6, 2012 · 7 comments

Comments

@ForbesLindesay
Copy link
Contributor

In the component script:

// local

var local = join(__dirname, bin);
if (exists(local)) bin = local;

Means we use the full path to the command, rather than just component-command we use C:\\Users\\Forbes\\AppData\\Roaming\\npm\\node_modules\\component\\bin\\component-command which doesn't work on windows. I'm not sure if this is needed elsewhere? It breaks component command and forces you to use component-command. A quick fix would be to instead do:

if (require('os').type() != 'Windows_NT') {
  var local = join(__dirname, bin);
  if (exists(local)) bin = local;
}

but I understand we don't want too much OS specific stuff slipping in... Thoughts @visionmedia?

@tj
Copy link
Contributor

tj commented Nov 6, 2012

hmm we must be able to exec a specific file on windows, without this you cant use component(1) unless globally installed

@ForbesLindesay
Copy link
Contributor Author

Hmm, true npm run-script does it somehow. I wonder how that works... At the moment it seems like it's tolerant of the fact that it's not an exe file or batch file, provided it's referenced as component-install but not if it's referenced with a full file path.

One option would be to just load them using require('./component-' + command) instead, that would be completely cross platform.

@tj
Copy link
Contributor

tj commented Nov 6, 2012

loading them with require() isnt the same as invoking them with proper args etc

@TooTallNate
Copy link
Contributor

The problem is that component-command is really component-commant.bat on Windows, which is not directly executable, but instead must be executed as the argument to cmd.exe. The upstream tracking issue is nodejs/node-v0.x-archive#2318.

@tj
Copy link
Contributor

tj commented Nov 6, 2012

going to close but only because component shouldn't even have to worry about this

@tj tj closed this as completed Nov 6, 2012
@ForbesLindesay
Copy link
Contributor Author

tbh I think it's not too big a deal if for now we make sure that all our docs take the form component-command then users will never run into it. I agree that ideally we would like to be able to ignore these issues, but we need good uptake of the tools, which means we can't really afford to lose all potential windows users.

@tj
Copy link
Contributor

tj commented Nov 6, 2012

we could always use work-arounds for now like your win-spawn module, that sort of idea, that we can weed out once node core is not a mess

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants