use npm api as documentated
fixed error message