0

I want to create a CSS documentation and installed KSS Doc: https://github.com/kneath/kss

But the script (kss --css ../styles/style.css --source styles) doesn't work as written in the doc. I don't use Webpack or any fremework, so only have a package.json file.

Here is how to use KSS: https://github.com/kss-node/kss-node

For example, $ kss --demo doesn't work. Should i add script in my package.json file, and if yes, what? Or do I need Webpack? I'm using node 10.15.3 and KSS is old too.

The error I get:

$ npm run kss --confignode_modules/kss/demo/kss-config.json
npm ERR! missing script: kss

I would like to be able to run the script, give the source and destination as explained in the doc. Thanks.

Grégory Huyghe
  • 422
  • 1
  • 6
  • 18

1 Answers1

1

You need to add a script to your package.json in order to run it:

{
    ...
    "scripts": {
         ...
        "kss": "node ./node_modules/kss/index.js" // `node` is required on Windows
    }
    ...
}

and then run it like this:

npm run kss -- --config node_modules/kss/demo/kss-config.json

Not the additional -- after the script name. It tells npm that the following arguments need to be passed to the kss command itself and not to the npm run command.

Sebastian Kaczmarek
  • 8,120
  • 4
  • 20
  • 38
  • I tried but it doesn't recognized the "." in the path. Sorry in French: '.' n'est pas reconnu en tant que commande interne ou externe, un programme ex▒cutable ou un fichier de commandes. I tried without and still an error. – Grégory Huyghe Nov 12 '19 at 09:47
  • What type of OS do you use? Linux/Windows/Mac? – Sebastian Kaczmarek Nov 12 '19 at 09:48
  • I use Windows 10. Same problem using Powershell. – Grégory Huyghe Nov 12 '19 at 09:51
  • I edited my answer. Try adding `node` before the file path in the `kss` script – Sebastian Kaczmarek Nov 12 '19 at 09:59
  • No error, I get this: > svn_desktop@1.0.0 kss H:\SVN_Desktop > node ./node_modules/kss/index.js "--config" "node_modules/kss/demo/kss-config.json" --- Don't know how to check if it worked. – Grégory Huyghe Nov 12 '19 at 10:01
  • 1
    If no error, then it looks like the command finished successfully and the root cause of your problem is fixed. In order to know what arguments you need to pass to the `kss` script, you have to read the docs and play with it. I don't know `kss` module so I can't help with that. Also I think that asking for concrete commands and arguments is a case for another question to keep each problem separated. The first one is already resolved ;) – Sebastian Kaczmarek Nov 12 '19 at 10:06