0

to generate document i want to use esdoc

esdoc -c esdoc.json

esdoc.json

{
   "source": "./src/",
   "destination": "./doc"
}

./src/index.js

/**
* @type {Object}
* @property {boolean} Foo.info
*/
var Foo = {
    info: true
};

export default Foo;

but it shows

\node_modules\esdoc\out\src\ESDoc.js:121
  results.push(...temp.results);
               ^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

what did i wrong?

fingerpich
  • 8,500
  • 2
  • 22
  • 32

2 Answers2

1

As one of the answers indicated, upgrade your node version - Had a similar problem and I did following (note I am on Mac OS X)

    brew upgrade node
    brew upgrade npm
    sudo npm cache clean -f
    sudo npm install -g n
    nvm install 7.8.0
    npm install -g esdoc

finally If you run

    esdoc

It should give you doc directory as expected; Hope it clarifies and helps others ...

anirudh.vyas
  • 552
  • 5
  • 11
0

ESDoc supports Node.js v6.0.0 or later

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
fingerpich
  • 8,500
  • 2
  • 22
  • 32