I know that
computer process itself instead of in a browser
Reading this, I try to open my terminal and run:
but I get zsh: unknown file attribute.
The same happens with
If I instead create a file
hello.js and put the console inside it and then I run:
it works. Why? What am I missing?
Sorry for the (maybe) stupid question
It’s because the
console.log('hello') is being evaluated by your shell (
zsh) before running the command and it has no idea what
console.log('hello') is. You could use the
$ node -e "console.log('hello')"