I'm trying to execute the command to start the project in Next.JS, which already exists, but it's saying that the dependency package below no longer exists:
npx @slicemachine/init@latest --repository spacetravelling-desafio2
Slice Machine → Init command started
We collect telemetry data to improve user experience.
Learn more: What Is Slice Machine? - Documentation - Prismic
Detected framework universal (no framework) and package manager yarn
Began core dependencies installation with yarn ... (running in background)
Logged in as email@example.com
Selected repository spacetravelling-desafio2 (flag repository used)
| Finishing core dependencies installation with yarn ...
→ info Visit yarn add | Yarn for documentation about this command.
Command failed with exit code 1: yarn add -D slice-machine-ui@latest @slicemachine/adapter-universal@latest --color
warning ..\package.json: No license field
warning slice-machine-ui > @prismicio/editor-fields > @firstname.lastname@example.org: Package renamed to @floating-ui/react
error An unexpected error occurred: "https://registry.yarnpkg.com/@slicemachine%2Fadapter-universal: Not found".
Dependency installation failed, try again with:
$ node C:\Users\user\AppData\Local\npm-cache_npx\b6923b01b288b666\node_modules@slicemachine\init\bin\slicemachine-init.js --repository spacetravelling-desafio2
I'm getting an error at the same part.
It's worth mentioning that I could only log in via the terminal if I did it super quickly. If it took me longer than half a second, it failed.
Did you manage to come up with a solution?
I haven't been able to find one yet here.
Hi, @giuzntt. Welcome to the Prismic forum. Thanks for the detailed information you have provided about the error.
You mentioned you are using Next.js, and I can see that the
@slicemachine/init package hasn't detected a framework. Have you already created your Next.js app? If so, could you provide a link to your code?
Hi, @david14. Welcome to the Prismic forum. Thanks for reaching out to let us know you’re experiencing a similar error. Can you confirm what framework you are using?
Here is the link to my project on GitHub Project, I have already created the Next.JS project. I was checking about the error.
Looks like the floatingUI package has been renamed, we should fix something in Prismic.
Link package in npm, Floating UI Renamed](@floating-ui/react-dom-interactions - npm
Thanks, @giuzntt, for providing your code. It looks like you’re using some older versions of Next.js, React, and our packages which need to be updated to be able to use the latest version of Slice Machine.
Can you update to the latest versions and let me know if the issue still occurs?
I figured out my issue based on your response to @giuzntt . I was using next@canary, their open beta branch. Once I moved to @latest, it worked fine.
What command did you put in the terminal to resolve this error?
I say to update Next.js
I tested it in another project and the error remains the same. Can you test on your side if the same error occurs with an existing project?
If you want you can clone my project https://github.com/Giuzntt/desafio-spacetravelling-rocketseat.
Hey, @david14. I'm glad to hear your issue was solved.
Hi, @giuzntt. I ran the following commands to update your project's packages.
npm update --force
npm install next@latest --force
npm install @prismicio/react@latest --force
npm install react-dom@latest --force
npm install react@latest --force
npm install @prismicio/next@latest --force
npx @slicemachine/init@latest should detect Next.js and install our Next.js Slice Machine adapter.
If you're still having issues, have you tried our Yarn workaround? Delete your
yarn.lock file and then run the
npx command again:
npx @slicemachine/init@latest. Then try installing your modules using
You should then be able to run your dev server using
yarn dev and Slice Machine using
npm run slicemachine.