Now I guess, NO need to configure mhchem.js at all, mathjax-node auto load mhchem.js if need.
My mistake is : I need to escape backslash in javascript strings. So I need to type '\\ce{H2SO4}' instead of '\ce{H2SO4'.
Following is my snippet, it works.
=======================
// a simple TeX-input example
var mjAPI = require("mathjax-node");
// No need to configure adding mhchem3/mhchem.js at all.
mjAPI.config({
MathJax: {
TeX:{
}
}
});
mjAPI.start();
// \\ce{...} double \\ is important, because we need to escape backslash in javascript string.
var yourMath = '\\ce{H2SO4}';
mjAPI.typeset({
math: yourMath,
format: "TeX", // "inline-TeX", "MathML"
svg: true, // svg:true,mml:true
}, function (data) {
if (!data.errors) {
console.log(data.svg)
}
});