# How to setup Prismic for Next.js 13 App Router

**URL:** <https://community.prismic.io/t/how-to-setup-prismic-for-next-js-13-app-router/13302>\
**Category:** Developing with Prismic\
**Tags:** nextjs\
**Created:** [June 13, 2023, 12:13pm UTC](https://community.prismic.io/t/how-to-setup-prismic-for-next-js-13-app-router/13302 "2023-06-13T12:13:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![avaneeshsamsi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/avaneeshsamsi/32/7347_2.png) [@avaneeshsamsi](https://community.prismic.io/u/avaneeshsamsi)\
**Post date:** [June 13, 2023, 12:13pm UTC](https://community.prismic.io/t/how-to-setup-prismic-for-next-js-13-app-router/13302/1 "2023-06-13T12:13:44Z")

</div>

Is `npx @slicemachine/init@latest --repository srot` still the right way to setup Prismic in a Next.js 13 project using the app directory? I saw the latest video on Prismic's YouTube about how Prismic supports the App Router. It explains everything really well but it doesn't walk through the setup.

Here's the error I receive when I run it:

```auto
| Finishing core dependencies installation with pnpm ...
  → EPERM EPERM: operation not permitted, rename 'E:\1. Code\projects\srot… 

Command failed with exit code 1: pnpm add -D slice-machine-ui@latest @slicemachine/adapter-next@latest --color

✖ Dependency installation failed, try again with:

```

Obviously, running pnpm run slicemachine doesn't work and start-slicemachine is not recognised.

Manually running that works, but now there's more missing peer deps

```auto
 WARN Issues with peer dependencies found
.
└─┬ @slicemachine/adapter-next
  ├─┬ @prismicio/types-internal
  │ ├── ✕ missing peer fp-ts@^2.11.8
  │ ├── ✕ missing peer io-ts@^2.2.16
  │ ├── ✕ missing peer io-ts-types@^0.5.16
  │ ├─┬ monocle-ts
  │ │ └── ✕ missing peer fp-ts@^2.5.0
  │ └─┬ newtype-ts
  │ └── ✕ missing peer fp-ts@^2.0.0
  └─┬ @slicemachine/plugin-kit
    └─┬ @prismicio/types-internal
      └── ✕ missing peer io-ts-types@^0.5.16
Peer dependencies that should be installed:
  fp-ts@">=2.11.8 <3.0.0" io-ts@^2.2.16
  io-ts-types@">=0.5.16 <0.6.0"

```

I then manually installed those leading to more missing peer deps - `monocle-ts newtype-ts`

After all that, start-slicemachine is still not recognised.

The cli scaffold also creates the slice-simulator.tsx in the pages dir.

Is there an updated way to set things up specifically for Next 13 and the App Dir?

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [June 13, 2023, 4:28pm UTC](https://community.prismic.io/t/how-to-setup-prismic-for-next-js-13-app-router/13302/4 "2023-06-13T16:28:06Z")

</div>

Hey! we've seen issues when using yarn or pnpm. I think, you can proceed with the installation using npm instead.
