Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compodoc: command not found

I installed the documentation tool "Compodoc" in my Angular application. First, I installed the tool globally and in my project

npm install -g @compodoc/compodoc
npm install --save-dev @compodoc/compodoc

I added the command to my package.json file in the "scripts" area with the following line

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

And it generated me the entire documentation files with this command :

npm run compodoc

Everything went good until I tried to run the command compodoc -s to see the documentation in my browser.

compodoc: command not found
like image 524
Sakolzer Avatar asked Nov 30 '17 10:11

Sakolzer


3 Answers

Just run "./node_modules/.bin/compodoc -s"

like image 57
Tobias Etter Avatar answered Oct 13 '22 12:10

Tobias Etter


In your package.json, for "compodoc" have the options you require and just run "npm run compodoc". For Example: "compodoc": "./node_modules/.bin/compodoc -p tsconfig-compodoc.json -d docs -n \"My Document Name\" --serve --port 3003 --theme postmark --hideGenerator --watch"

It should run. Hope it helped. Thanks:)

like image 43
Clinton Roy Avatar answered Oct 13 '22 12:10

Clinton Roy


Adding this for Angular 9 users:

tell it to create the documentation elsewhere so that 'ng serve' doesn't get confused by the changes caused by the documentation folder if you are using the 'w' folder

Add this package. json then you can run 'npm run compodoc'. Also, In Angular 9, now I see that I have to specify what folder to watch as well - '-w' means watch the source folder.

"scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "compodoc": "./node_modules/.bin/compodoc -p tsconfig.json -w ./src -s --output ../Path To where you want the documentation/documentation --silent" },

like image 25
Pejman Saberin Avatar answered Oct 13 '22 12:10

Pejman Saberin