This question Node.js prompt '>' can not show in eshell solve the problem for the node repl, but that solution don't work when you call node from npm.
By example if I make
$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sane defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg> --save` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
^[[1G^[[0Jname: (nodo1) ^[[15G
Or if you have a package.json with a "scripts" : { "start" : "node" }
$ npm start
npm WARN package.json nodo1@0.0.1 No README.md file found!
> node
^[[1G^[[0J> ^[[3G
I know this one could be solved using "start" : "env NODE_NO_READLINE=1 node", but write this everywhere isn't a find solution. And maybe other user of the package don't use emacs and need set the env var in other way.
I have try with a alias for npm setting NODE_NO_READLINE=1 but the same result
alias npm='env NODE_NO_READLINE=1 npm'