Opened 9 years ago
Closed 9 years ago
#14540 closed defect (fixed)
node.js detection broken on Linux
Reported by: | MaxMotovilov | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | blocker | Milestone: | 1.7.3 |
Component: | Loader | Version: | 1.7.1 |
Keywords: | node.js backport | Cc: | |
Blocked By: | Blocking: |
Description
https://github.com/dojo/dojo/commit/2abfde8208260b838fcf63844a9a276c251c3ca1
Some improvement... typical installation (nodejs deb package on Ubuntu in my case) results in
process.exePath=='/usr/bin/nodejs'
and the current detection regex misses that. Rolling this commit back should do the trick
Change History (11)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
The problem is the code tries to detect the name of a process, which is brittle, and error-prone (see navigator.userAgent
and associated problems). It is much safer to detect an environment, or prominent features, instead of superficial features like OS-dependent process information.
Some detection variants are listed on SO: http://stackoverflow.com/questions/4224606/how-to-check-whether-a-script-is-running-under-node-js
comment:6 Changed 9 years ago by
Thanks for attending to this Eugene!
I improved the sniff so that I can't see how looking at the executable is still necessary; also allow explicit user override.
Here is an example node.js program that uses the override
global.dojoConfig = { has:{ "host-node":1 } }; require("path/to/dojo.js");
This program could be executed [e.g.] by the command line...
node path/to/example/above.js load=some/module/to/load
Of course the load= is optional
Tested with node renamed to nodex on linux...all seems good.
comment:7 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|
comment:9 Changed 9 years ago by
Keywords: | backport added |
---|---|
Milestone: | 1.8 → 1.7.3 |
Priority: | high → blocker |
Resolution: | fixed |
Status: | closed → reopened |
Please backport to 1.7 branch.
comment:10 Changed 9 years ago by
Status: | reopened → assigned |
---|
The problem is that the executable is called nodejs instead of node?