CLI only works if you have scripts in package.json
jonmumm opened this issue · 1 comments
jonmumm commented
Bug report
❯ npx chromatic --project-token=XXXXX
✖ Invalid package.json
Found invalid package.json at xxxx/package.json
Make sure this is a valid Node.js package file, is readable, and contains a "scripts" block.
In my project, we don't have any scripts
in package.json because we're using NX for scripts, so I'm having to create a fake script just to run chromatic cli. It works but not ideal.
thafryer commented
@jonmumm Thanks for reaching out! Can you try adding the --storybook-build-dir REPLACE_ME_WITH_DIR
here? The CLI currently infers how to build your storybook from the package.json file. If you build your storybook using the NX command and then point the CLI at the output directory using the flag above, you should get the desired outcome. Please reopen this issue if it does not work for you!