4

I am trying to document my Angular + Typescript application. I'm using Compodoc for that. I installed compodoc using npm by running the command

   'npm install -g compodoc'. And added 

   "compodoc": "./node_modules/.bin/compodoc -p src/tsconfig.json"  

in my scripts in package.json. When I run npm run compodoc I'm getting this error

PS D:\Moya Proj\VITMOBAPPHYD2016> npm run compodoc

[email protected] compodoc D:\Moya Proj\VITMOBAPPHYD2016 compodoc -p src/tsconfig.json

                                            _
                                           | |
    ___    ___    _ __ ___    _ __     ___     __| |   ___     ___
   / __|  / _ \  | '_ ` _ \  | '_ \   / _ \   / _` |  / _ \   / __|
  | (__  | (_) | | | | | | | | |_) | | (_) | | (_| | | (_) | | (__   0.0.41
   \___|  \___/  |_| |_| |_| | .__/   \___/   \__,_|  \___/   \___|
                       | |
                       |_|

[11:08:57] "tsconfig.json" file was not found in the current directory npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] compodoc: compodoc -p src/tsconfig.json

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the [email protected] compodoc script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! C:\Users\Shahid.tabrez\AppData\Roaming\npm-cache_logs\2018-06-15T05_38_57_267Z-debug.log

Should I add anything to my tsconfig.json Or is there anything wrong in what I've done. Thanks in advance.

3
  • Check this video out: youtu.be/xJSKZ1DE4Go Simon explains in detail how it is installed Commented Jun 15, 2018 at 6:12
  • 2
    Thank You but ive found the answer. I should have ran this 'compodoc -p ./tsconfig.json' Commented Jun 15, 2018 at 7:13
  • 2
    Thank you so much, you saved my life. I was also getting tsconfig.json not found error, but tried running compodoc -p ./tsconfig.json instead, and it worked. Commented Oct 26, 2018 at 12:59

1 Answer 1

1

Just check whether the path is correctly mentioned under "scripts" object in package.json file. By default the path is "src/tsconfig.app.json". If your tsconfig.app.json is not at the mentioned path, modify the path and check, it will work definitely

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.