diff options
Diffstat (limited to 'compiler/nodejs.nim')
-rw-r--r-- | compiler/nodejs.nim | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/nodejs.nim b/compiler/nodejs.nim index 7f9f28aaf..9753e1c99 100644 --- a/compiler/nodejs.nim +++ b/compiler/nodejs.nim @@ -1,8 +1,10 @@ -import os +import std/os -proc findNodeJs*(): string = +proc findNodeJs*(): string {.inline.} = + ## Find NodeJS executable and return it as a string. result = findExe("nodejs") - if result == "": + if result.len == 0: result = findExe("node") - if result == "": - result = findExe("iojs") + if result.len == 0: + echo "Please install NodeJS first, see https://nodejs.org/en/download" + raise newException(IOError, "NodeJS not found in PATH") |