nim js -d:nodejs -r main.nim
I get this error message
ReferenceError: globalThis is not defined
If you experience errors saying that globalThis is not defined, be sure to run a recent version of Node.js (at least 12.0).
node -v v14.4.0
Any ideas?
Also, will this work in Browser because I see many
var F={procname:"module macros",prev:framePtr,filename:"/.......path...../.choosenim/toolchains/nim-1.4.4/lib/core/macros.nim",line:0}; Definitely this thing won't work in Browser.
node -e 'console.log(globalThis)'
ok; so next step is figure out if it's a user error, or if findNodeJs is buggy, or if findExe is buggy (findExe has many bugs, but maybe this isn't related)
proc findNodeJs*(): string {.inline.} =
## Find NodeJS executable and return it as a string.
result = findExe("nodejs")
if result == "":
result = findExe("node")
what is: node -v nodejs -v
ok. I see I have two installed on my machine...
when I type
$ node -v 14.4.0
$ nodejs -v v10.19.0
I remember i installed nodejs only though nvm but it looks i have two nodejs now on Ubuntu