# Nuxt.js Slice Machine Project Setup

**URL:** <https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685>\
**Category:** Developing with Prismic\
**Tags:** slice-machine\
**Created:** [March 25, 2021, 8:21pm UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685 "2021-03-25T20:21:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![david3](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@david3](https://community.prismic.io/u/david3)\
**Post date:** [March 25, 2021, 8:21pm UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/1 "2021-03-25T20:21:51Z")

</div>

Hello. I'm following [this](https://prismic.io/docs/technologies/recreate-banner-as-component-nuxtjs) article in order to start my first CMS site. There's me worrying about `asyncData` and I can't even start Slice Machine 😛

Having created my first slice, I can get as far as this next command which does execute successfully

```auto
prismic sm --add-storybook

```

But it's the next one

```auto
prismic sm --develop

```

My terminal greets me with

```auto
[slices API]: Unauthorized

```

My Prismic login doesn't work here, I did see a [couple](https://community.prismic.io/t/troubleshooting-slice-machine-slice-builder/3002) of threads on this. One suggested logout and login, done that no success. One had trouble with Node but after updating that to the latest still no change. The other said to check the `sm.json`, my `apiEndpoint` seems O.K:

```auto
{
  "libraries": [
    "@/slices",
    "vue-essential-slices"
  ],
  "apiEndpoint": "https://api.slicemachine.dev/2020-10-27",
  "storybook": "http://localhost:3003"
}

```

Could the fact that I am setting this up on an external hard drive be a key factor? That's the only thing I'm doing that's not normal I guess. Everything else seemed to install, however. Everything in the step-by-step article for Nuxt and Prismic.

Package.json if it's any use:

```auto
"scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "storybook": "nuxt storybook",
    "build-storybook": "nuxt storybook build"
  },
  "dependencies": {
    "@nuxtjs/prismic": "^1.2.6",
    "@prismicio/vue": "^2.0.11",
    "core-js": "^3.9.1",
    "nuxt": "^2.15.3",
    "nuxt-sm": "0.0.6",
    "prismic-javascript": "^3.0.2",
    "vue-essential-slices": "^0.3.0",
    "vue-slicezone": "0.0.30"
  },
  "devDependencies": {
    "@nuxtjs/storybook": "^3.3.1",
    "babel-loader": "^8.2.2"
  }

```

Appreciate any help and support.

**Repo [here](https://bitbucket.org/daxchdesign/dcd-holding/src).**

😃 😃 😃

---

<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:** [March 26, 2021, 10:58am UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/2 "2021-03-26T10:58:20Z")

</div>

Hi David,

Welcome to the community!

It seems the issue here is that the API endpoint defined in your `sm.json` file isn't a prismic repo:  
[https://bitbucket.org/daxchdesign/dcd-holding/src/master/sm.json](https://bitbucket.org/daxchdesign/dcd-holding/src/master/sm.json)

You also don't have anything defined for the prismic module in your nuxt.config.js file:  
[https://bitbucket.org/daxchdesign/dcd-holding/src/master/nuxt.config.js](https://bitbucket.org/daxchdesign/dcd-holding/src/master/nuxt.config.js)

You might want to look at this example project which has things pre-configured:

> **[prismicio/nuxtjs-website](https://github.com/prismicio/nuxtjs-website)**
>
> Contribute to prismicio/nuxtjs-website development by creating an account on GitHub.

Also, the article you linked is the second in a series so you should start from the 1st:

> **[Configure Your Project with Nuxt.js](https://prismic.io/docs/technologies/configure-your-project-nuxtjs)**
>
> We'll be getting everything we need for this tutorial series setup and prepared. This includes downloading the initial project files, launching a Prismic repository, and installing the required dependencies with Nuxt.js.

Let me know if you have any other questions.

Thanks.

---

<div class="post-metadata">

**Author:** ![david3](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@david3](https://community.prismic.io/u/david3)\
**Post date:** [March 26, 2021, 11:12am UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/4 "2021-03-26T11:12:19Z")

</div>

Hi Phil, thank you for your response.

I did start from the first one though, from where you first install Nuxt and create the app. Shouldn't this have done everything for me that you mentioned? If I am to copy the Nuxt.config.js file from your link and rebuild will this likely resolve the issue?

---

<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:** [March 26, 2021, 11:13am UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/5 "2021-03-26T11:13:22Z")

</div>

Yes, it should have updated the nuxt config, but there's no way it would have added the endpoint which you have in the sm.json, so I'm confused.

---

<div class="post-metadata">

**Author:** ![david3](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@david3](https://community.prismic.io/u/david3)\
**Post date:** [March 26, 2021, 11:39am UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/6 "2021-03-26T11:39:46Z")

</div>

I didn’t just conjure that from nowhere. It updated it for sure. I’m going to try again from scratch and see. Thanks for your prompt response.

---

<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:** [March 26, 2021, 11:40am UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/7 "2021-03-26T11:40:24Z")

</div>

No problem we'll work through this together 🙂

---

<div class="post-metadata">

**Author:** ![david3](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@david3](https://community.prismic.io/u/david3)\
**Post date:** [March 26, 2021, 1:20pm UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/8 "2021-03-26T13:20:00Z")

</div>

I have tried again, Phil - deleted the repo. Started from the link you sent, with the same result.

This is the apiEndpoint that's added:

"apiEndpoint": "[https://api.slicemachine.dev/2020-10-27](https://api.slicemachine.dev/2020-10-27)",

May I please politely ask you to try creating a Nuxt app following the article to see if I am indeed going mad?

Perhaps I am doing some settings incorrect in the article it says "It will ask you some questions (name, Nuxt options, UI framework, TypeScript, linter, testing framework, etc.)." I wonder what these settings should be for Nuxt seeing as the Nuxt.config.js you added has CSS references etc or is this added by another command?

---

<div class="post-metadata">

**Author:** ![david3](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@david3](https://community.prismic.io/u/david3)\
**Post date:** [March 26, 2021, 2:02pm UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/9 "2021-03-26T14:02:49Z")

</div>

Me again, Phil - I have just tried this on another machine with success! 😃 Wahooo. No idea what is wrong with the other machine. Out the window, it goes. Thanks for your support!

---

<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:** [March 26, 2021, 2:26pm UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/10 "2021-03-26T14:26:31Z")

</div>

I'm glad you got this working, if already had this "apiEndpoint": "[https://api.slicemachine.dev/2020-10-27](https://api.slicemachine.dev/2020-10-27)", then running the `--setup` command wouldn't overwrite this.

I think the create nuxt questions are a bit confusing so I will make a change to using a boilerplate project in this tutorial series soon, which should be much easier.

Let me know if you have any other questions.

---

<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:** [March 27, 2021, 2:26pm UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/11 "2021-03-27T14:26:38Z")

</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:55pm UTC](https://community.prismic.io/t/nuxt-js-slice-machine-project-setup/4685/12 "2021-12-09T17:55:24Z")

</div>


