ERR_BAD_REQUEST 401 when trying to install slice machine

I'm just trying to get started and i'm following the instructions given to me and when I put in

npx @slicemachine/init --repository project-name

i get

PS C:\Projects\project-name> npx @slicemachine/init --repository project-name
You're about to configure Slicemachine... Press ctrl + C to cancel
:heavy_check_mark: Logged in as
:heavy_check_mark: Next.js detected
:heavy_check_mark: Pushing existing Slice models to your repository
:heavy_check_mark: Pushing existing custom types to your repository
:heavy_multiplication_x: Pushing existing documents to your repository
Error! Sending documents failed, please try again. If the problem persists, contact us.
Error! Full error: ERR_BAD_REQUEST - Request failed with status code 401

what's the deal?

Hello @dale.salcedo

Welcome to the Prismic community.

I need the following:

  1. URL of the starter you are using?
  2. What version of prismic-cli and npm are you using? You might need to update them.

I am looking forward to hearing from you.


Hi @Priyanka,

I'm also having this issue with a starter.

I'm using a the demo starter via the docs:

npx degit GitHub - prismicio-community/crash-course-next: The fastest way to learn Prismic, a headless website builder. crash-course-next
cd crash-course-next
npx @slicemachine/init

:heavy_check_mark: Logged in as
:heavy_check_mark: Next.js detected
:information_source: The name acts as a domain/endpoint for your content repo and should be completely unique.
? Name your Prismic repository
:heavy_multiplication_x: Error creating repository testreponext
Error! Request failed with status code 401
Error! We failed to create you new prismic repository

using npm v9.5.1

Can you assist?

Hello @jnz.lee

Welcome to the Prismic community forum, and thanks for reaching out to us.

I have tested the crash course docs and can not reproduce the issue. The repository is created, and everything works well (Screens shot attached)

Can you update the npm version to 9.6.4 and check again? To update the version, run the following command:
npm install -g npm@9.6.4

Give this a try, and let me know.


@Priyanka I am having the same issue when running the following command:

npx @slicemachine/init@latest

I have tried both to create a new repository and selecting an already existing repository but I keep getting the following error:

Pushing data to Prismic...
:heavy_check_mark: Pushed all slices
:heavy_check_mark: Pushed all custom types
:heavy_multiplication_x: Pushing documents...
→ Failed to push documents to repository ***, 401 Unauthoriz…
Cleaning up data push artifacts
Error: Failed to push documents to repository ***, 401 Unauthorized

Are you able to help? Thank you!

Hello @ben.pluim

I apologize for the delayed response. Are you still getting the error?


Unfortunately, it was a little urgent and I ended up moving onto using another headless CMS, but I am still very interested in learning/setting up Prismic. I will try again to see if I still get the error and will ping you here. Thank you!

Hello @ben.pluim

I apologize for not coming back to you on time. I assure you we can resolve the issue together.
401 error usually is an authentication error. Can you try logout and retry login from the terminal?
What version of npm and node do you have in your locale?
If nothing works, I'd be more than happy to debug deeply. To debug this, I need the Prismic repo name and project files. I will check it on my local.
You can send me a private message.


I'm also getting the same error when setting up a template. This is not a very good first time experience? just following the sample

Hello @dario.villanueva

Which sample are you following?