Question mark provides help when launching from REPL but not from ATOM notebook

The question mark provides help when launching from REPL. Example:
help?> ?
search:
Welcome to Julia 1.4.2. The full manual is available at…

The question mark does NOT provide help when launching from ATOM notebook. Example:
syntax: invalid identifier name “?”
in top-level scope at my line in the code

Why is that happening and how to resolve it?

The REPL is a GUI for the Julia language. It does not behave exactly the same as, for example, executing a script. As you noted, the “help” interface is not accessible from a script. There is no way to “resolve” what is happening exactly, except not to put syntax that isn’t allowed into scripts and files.

Atom has two parts, the editor and the console, that “simulates” the repl. Just put the question mark in the console (or use directly the Juno documentation panel, that should bring u to the same documentation)