I would like to generate automatic documentation for my javascript project using JSDoc running on Nodejs. I did the following:
- Installed Nodejs
- Installed jsdoc from nodejs as follows: npm install jsdoc
Everything seemed to go well. Then, I run JSDoc on a sample javascript file:
c:>jsdoc d:\version.js
C:\Users\Mark\AppData\Roaming\npm\node_modules\jsdoc\cli.js:341 packageDocs = new Package(props.packageJson); ^ TypeError: undefined is not a function at Object.module.exports.cli.parseFiles (C:\Users\Mark\AppData\Roaming\npm\n ode_modules\jsdoc\cli.js:341:19) at module.exports.cli.main (C:\Users\Mark\AppData\Roaming\npm\node_modules\j sdoc\cli.js:232:14) at Object.module.exports.cli.runCommand (C:\Users\Mark\AppData\Roaming\npm\n ode_modules\jsdoc\cli.js:189:5) at C:\Users\Mark\AppData\Roaming\npm\node_modules\jsdoc\jsdoc.js:178:13 at Object. (C:\Users\Mark\AppData\Roaming\npm\node_modules\jsdoc\ jsdoc.js:180:3) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10)
Please note I get this error no matter where I run jsdoc from and no matter which javascript file I use.
Can anyone help?
Update If I delete lines 341-343 in cli.js, everything runs fine. Is it possible that these three lines are particular to a particular (i.e. non-windows) environment?