Skip to content
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

[CLOSED] Node.js vs io.js detection #9396

Open
core-ai-bot opened this issue Aug 30, 2021 · 4 comments
Open

[CLOSED] Node.js vs io.js detection #9396

core-ai-bot opened this issue Aug 30, 2021 · 4 comments

Comments

@core-ai-bot
Copy link
Member

Issue by jasonsanjose
Thursday Feb 26, 2015 at 18:51 GMT
Originally opened as adobe/brackets#10658


Now that io.js has forked, modules like node-sass are relying on the name of the executable to detect node vs. io.js.

Examples:

https://github.com/sass/node-sass/blob/master/lib/extensions.js#L9 resolves to Brackets-node

function getRuntimeInfo() {
  var execPath = fs.realpathSync(process.execPath); // resolve symbolic link

  var runtime = execPath
               .split(/[\\/]+/).pop()
               .split('.').shift();

  runtime = runtime === 'nodejs' ? 'node' : runtime;

  return {
    name: runtime,
    execPath: execPath
  };
}

Another example at stackexchange uses the same technique http://stackoverflow.com/questions/28259154/is-there-a-reliable-way-of-detecting-whether-io-js-or-node-js-is-running?rq=1.

Part of the responsibility should be on packages to do more robust detection. However, my question is, is there still a compelling reason to name our binary Brackets-node?

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Feb 26, 2015 at 18:59 GMT


Also, it's worth noting that node-sass is fixing their approach in a future release sass/node-sass#694.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday Feb 26, 2015 at 19:00 GMT


I think@busykai was looking into trying to rename the binary back to just plain node. IIRC there was some problem with our native extension for Windows file watching if we didn't rename it...?

@core-ai-bot
Copy link
Member Author

Comment by busykai
Tuesday Mar 03, 2015 at 17:43 GMT


@peterflynn, I was going the other way, actually. :) I wanted to rename Windows node.exe to Brackets-node.exe.

@jasonsanjose, I believe the major reason to have it as Brackets-node is to be able to distinguish it from other node processes which could be running on the system (for example, if one wanted to debug or restart it).

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Saturday Sep 03, 2016 at 17:42 GMT


Not valid issue anymore, closing

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

No branches or pull requests

1 participant