clenemt / docdash

:zap: Lodash inspired JSDoc 3 template/theme
http://clenemt.github.io/docdash/
Other
824 stars 201 forks source link

Npm run generate-docs Fails after generating the output file #69

Closed raulkozy closed 5 years ago

raulkozy commented 5 years ago

I was trying to create a JS documentation for my Node-express application. followed the steps as mentioned in https://github.com/clenemt/docdash

Below is the snap representing Package.json

image

The JsDoc.json is as follows

{
    "source": {
        "include": [
            "./controller/index.js",
            "./middleware/",
            "./utility/",
            "./routes/index.js"
        ]
    },
    "tags":{
       "allowUnknownTags":true,
       "dictionaries":[
          "jsdoc"
       ]
    },
    "plugins":[
       "plugins/markdown",
       "plugins/shout"
    ],
    "markdown":{
       "idInHeadings":true,
       "hardwrap":true
    },
    "opts":{
       "template":"node_modules/docdash/",
       "encoding":"utf8",
       "destination":"./documentation/",
       "recurse":true,
       "verbose":true
    },
    "templates":{
       "cleverLinks":true,
       "monospaceLinks":true
    },
    "docdash":{
       "collapse":true,
       "search":true
    }
 }

While generating the docs using the npm run generate-docs script getting the error as below.

image

Kindly help to resolve this

ar2rsawseen commented 5 years ago

Hello, unfortunately I am not sure, what could be the issue. Can you provide the debug log that is listed in the end of the error?

raulkozy commented 5 years ago

Hi @ar2rsawseen ,

Below is the debug log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'generate-docs' ]
2 info using npm@6.9.0
3 info using node@v11.12.0
4 verbose run-script [ 'pregenerate-docs', 'generate-docs', 'postgenerate-docs' ]
5 info lifecycle keycloak_middleware@1.0.0~pregenerate-docs: PROJECT_NAME@1.0.0
6 info lifecycle keycloak_middleware@1.0.0~generate-docs: PROJECT_NAME@1.0.0
7 verbose lifecycle keycloak_middleware@1.0.0~generate-docs: unsafe-perm in lifecycle true
8 verbose lifecycle keycloak_middleware@1.0.0~generate-docs: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/rahulkohli/Desktop/Services/iam-ms/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
9 verbose lifecycle PROJECT_NAME@1.0.0~generate-docs: CWD: /home/rahulkohli/Desktop/Services/iam-ms
10 silly lifecycle PROJECT_NAME@1.0.0~generate-docs: Args: [ '-c',
10 silly lifecycle   'jsdoc -c jsdoc.json && cp -R ./jsdoc.css ./out/styles/' ]
11 silly lifecycle PROJECT_NAME@1.0.0~generate-docs: Returned: code: 1  signal: null
12 info lifecycle PROJECT_NAME@1.0.0~generate-docs: Failed to exec generate-docs script
13 verbose stack Error: PROJECT_NAME@1.0.0 generate-docs: `jsdoc -c jsdoc.json && cp -R ./jsdoc.css ./out/styles/`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:197:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:197:13)
13 verbose stack     at maybeClose (internal/child_process.js:988:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid PROJECT_NAME@1.0.0
15 verbose cwd /home/rahulkohli/Desktop/Services/iam-ms
16 verbose Linux 4.15.0-33-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "generate-docs"
18 verbose node v11.12.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error PROJECT_NAME@1.0.0 generate-docs: `jsdoc -c jsdoc.json && cp -R ./jsdoc.css ./out/styles/`
22 error Exit status 1
23 error Failed at the PROJECT_NAME@1.0.0 generate-docs script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
ar2rsawseen commented 5 years ago

I still dont see any problem and if you try it without copying files afterwards, it still produces this error?

raulkozy commented 5 years ago

@rahulkohli23 I tried hitting the command

node_modules/jsdoc/jsdoc.js -c jsdoc.json

i.e. without copying the files, this gave me the exact error. After resolving the same. The script worked fine.

Thanks for your help.