Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use storyshots command in terminal #1396

Closed
xareelee opened this issue Jul 1, 2017 · 7 comments
Closed

Can't use storyshots command in terminal #1396

xareelee opened this issue Jul 1, 2017 · 7 comments
Assignees

Comments

@xareelee
Copy link

xareelee commented Jul 1, 2017

Following https://storybook.js.org/testing/structural-testing/#using-storyshots to add the script and run it:

yarn run test-storybook

but it shows command not found:

yarn run v0.22.0
$ storyshots 
sh: storyshots: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 
@ndelangen
Copy link
Member

ndelangen commented Jul 3, 2017

Have you added the script to package.json?

Then, add the following NPM script into your package.json:

{
  "scripts": {
    "test-storybook": "storyshots"
  }
}

@xareelee
Copy link
Author

xareelee commented Jul 4, 2017

@ndelangen YES, definitely. 😃

yarn run v0.22.0
$ storyshots 
sh: storyshots: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 

The second line indicates what the command the script executes. The command not found is storyshots not test-storybook.

Do I need to install storyshots globally?

@ndelangen
Copy link
Member

You should run npm run storyshots which in turn will run storyshots but within a npm 'context' causing the command exposed in ./node_modules/.bin/ to be available.

Is this what you're doing?

@tmeasday Are the docs correct here?

@tmeasday
Copy link
Member

tmeasday commented Jul 5, 2017

@ndelangen I am surprised to see this in the docs, as far as I am aware, storyshots does not ship with any bin scripts: https://github.com/storybooks/storybook/blob/master/addons/storyshots/package.json

I'm not sure what's going on there. I suppose we should get rid of that.

@xareelee
Copy link
Author

xareelee commented Jul 6, 2017

@ndelangen

The command yarn run storyshots equals to npm run storyshots. They just find and execute the script in the package.json.

The issue is there is no such command storyshots in the node_modules/.bin/ for cli.

@shilman
Copy link
Member

shilman commented Jul 6, 2017

@xareelee the documentation is wrong. i've fixed it here: #1421

@ndelangen @tmeasday your review appreciated

@ndelangen
Copy link
Member

LGTM, @shilman

Does this fix your problem @xareelee ? If not feel free to reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants