# Failed to run command \`nuxt-storybook\`

**URL:** <https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065>\
**Category:** Developing with Prismic\
**Tags:** nuxtjs\
**Created:** [November 23, 2021, 5:13pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065 "2021-11-23T17:13:49Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![bipolab](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@bipolab](https://community.prismic.io/u/bipolab)\
**Post date:** [November 23, 2021, 5:13pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/1 "2021-11-23T17:13:49Z")

</div>

Hi, I'm following the tutorial to install nuxt-storybook but it doesn't work.

When I run "prismic sm --add-storybook", it creates a conflict where I have to overwrite both the package.json file and the sm.json file.

Second, it doesn't install the ".nuxt-storybook" and ".slicemachine" folders

Can someone help me please. I do not understand absolutely anything of what is happening and I have wasted all day dealing with this problem.

---

<div class="post-metadata">

**Author:** ![australian.nick](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@australian.nick](https://community.prismic.io/u/australian.nick)\
**Post date:** [November 24, 2021, 12:59pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/2 "2021-11-24T12:59:58Z")

</div>

Hi bipolab... I am in the same boat:

- prismic-cli/4.2.0 darwin-x64 node-v16.13.0

And general package.json as:  
"dependencies": {  
"@nuxtjs/prismic": "^1.3.2",  
"core-js": "^3.15.1",  
"nuxt": "^2.15.7",  
"nuxt-sm": "^0.0.8",  
"vue-slicezone": "^0.1.0"  
},  
"devDependencies": {  
"@nuxtjs/storybook": "4.0.2",  
"@nuxtjs/tailwindcss": "^4.2.0",  
"@storybook/vue": "6.1.21",  
"@vue/test-utils": "^1.2.1",  
"babel-core": "7.0.0-bridge.0",  
"babel-jest": "^27.0.5",  
"jest": "^27.0.5",  
"postcss": "^8",  
"slice-machine-ui": "^0.1.1",  
"vue-jest": "^3.0.4",  
"vue-loader": "15.9.6"  
}  
}

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [November 24, 2021, 2:45pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/4 "2021-11-24T14:45:56Z")

</div>

Hi Team,

I'm sorry to see you're having this issue. I'm going to investigate this now.

Thanks.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [November 24, 2021, 7:23pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/5 "2021-11-24T19:23:36Z")

</div>

Hey @bipolab & @australian.nick ,

I was investigating this and have encountered the same issue.

So there's a few things:

> [@bipolab](#):
>
> Second, it doesn't install the ".nuxt-storybook" and ".slicemachine" folders

This is a bit of misinformation in the documentation, these files are generated when you run `npm run storybook` and `npm run slice machine` respectively.

> [@bipolab](#):
>
> When I run "prismic sm --add-storybook", it creates a conflict where I have to overwrite both the package.json file and the sm.json file.

Overwrite is probably the wrong word to use in the command, it will update these files. If you enter `d` when it questions you whether to overwrite these files is will show you the changes it will make and you can see there's no issue here.

## Running Storybook errors

When I ran `npm run storybook` on my side I got 2 errors:

 ![Screenshot 2021-11-24 at 20.01.56](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/e/e8b6c979d4daf79c29a45a930029b9dbf9d3b46a.png)

The second error I resolved by running:

```auto
npm install --save @storybook/addon-actions

```

But for the error about Storybook and Slice Machine, I haven't been able to find a solution and it's still causing the following error.

```auto
✖ Nuxt Fatal Error                                       
                                                          
Failed to run command `nuxt-storybook`:                  
Error: Command failed with exit code 1: nuxt-storybook 

```

I'm still investigating and I'll bring this up with the team to try and get this working. Once I know more I'll update you here.

Thanks.

---

<div class="post-metadata">

**Author:** ![australian.nick](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@australian.nick](https://community.prismic.io/u/australian.nick)\
**Post date:** [November 25, 2021, 8:32am UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/6 "2021-11-25T08:32:26Z")

</div>

Phil, thanks for your follow up. I'll watch with interest and push around myself a bit more too. Cheers.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [November 25, 2021, 2:04pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/11 "2021-11-25T14:04:18Z")

</div>

OK, I figured it out. The script adds the following, in the `nuxt.config.js`:

```auto
stories: [...getStoriesPaths().map(path => path.replace("../", "~/")), ...getStoriesPaths()]

```

You need to replace this with:

```auto
stories: [...getStoriesPaths().map(path => path.replace("../", "~/"))]

```

The second `getStoriesPaths()` function is an error and the team is fixing this now.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [November 26, 2021, 11:45am UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/22 "2021-11-26T11:45:51Z")

</div>

Hey Team,

So I was able to recreate your issue, thank you for providing me with all the information. Once I changed my Node version to V.14 I got the same error as you.

The fix is either to upgrade to Node V.16, or to update `@nuxtjs/storybook` & `@storybook/vue` with:

```auto
npm i @nuxtjs/storybook@latest @storybook/vue@latest

```

Also you don't need `@storybook/addon-actions` installed.

I'm glad we figured this out together, thanks.

---

<div class="post-metadata">

**Author:** ![bipolab](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@bipolab](https://community.prismic.io/u/bipolab)\
**Post date:** [November 26, 2021, 3:37pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/29 "2021-11-26T15:37:33Z")

</div>

[bipolab-prismic copia.zip](https://community.prismic.io/uploads/short-url/wi4jWYsFLPr0Lcx9SoUW5KGsO1G.zip) (335.3 KB)

Prismic and Node version: `prismic-cli/4.2.0 darwin-x64 node-v16.13.0`

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [November 29, 2021, 9:53am UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/33 "2021-11-29T09:53:15Z")

</div>

Hey,

So I didn't realise you were testing in Yarn. It seems there's an issue with the Yarn, Nuxt and Webpack with the css loader. You need to install `sass-loader` to get this working.

```auto
yarn add sass-loader@10.1.0

```

Remember to delete your `yarn.lock` when installing the node modules from scratch. I also updated these packages to the latest:

```auto
"@nuxtjs/storybook": "^4.2.0",
"@storybook/vue": "^6.4.0",

```

Here's your project working:  
[bipolab-prismic-edit.zip](https://community.prismic.io/uploads/short-url/4Ad5xxoPE10d0TYiOrr6s7i7Ua6.zip) (349.2 KB)

---

<div class="post-metadata">

**Author:** ![bipolab](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@bipolab](https://community.prismic.io/u/bipolab)\
**Post date:** [November 29, 2021, 3:36pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/34 "2021-11-29T15:36:30Z")

</div>

Solved!!!! Thank you Phil!!!  
If someday I find you on the street, let me buy you a beer !! XDXD

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [November 29, 2021, 3:39pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/35 "2021-11-29T15:39:10Z")

</div>

That's my sort of reward 🙂

Happy to help, I've passed all this feedback to the team.

I'm going to clean this thread up a bit now.

---

<div class="post-metadata">

**Author:** ![anthony.d.colli](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@anthony.d.colli](https://community.prismic.io/u/anthony.d.colli)\
**Post date:** [November 30, 2021, 2:18pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/36 "2021-11-30T14:18:37Z")

</div>

I was having a similar issue as well and this guide was perfect and I was able to run slicemachine and storybook. But now when I run "yarn dev" I get

`Module build failed (from ./node_modules/postcss-loader/dist/cjs.js): ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema. - options has an unknown property 'order'.`

I've tried installing the postcss and cssloader dependancies and that leads to a different error below.

```auto
TypeError: this.getOptions is not a function in vue.js

```

Any guidance on this would be great.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [November 30, 2021, 2:24pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/37 "2021-11-30T14:24:09Z")

</div>

Can you try deleting your node modules and yarn lock, then running yarn add again?

---

<div class="post-metadata">

**Author:** ![anthony.d.colli](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@anthony.d.colli](https://community.prismic.io/u/anthony.d.colli)\
**Post date:** [November 30, 2021, 3:45pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/38 "2021-11-30T15:45:46Z")

</div>

Deleting the node modules and running yarn again seemed to fix it. Thank you, finally up and running!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 1, 2021, 3:46pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/39 "2021-12-01T15:46:22Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:07pm UTC](https://community.prismic.io/t/failed-to-run-command-nuxt-storybook/8065/40 "2021-12-09T17:07:32Z")

</div>


