Closed darrenbarklie closed 3 years ago
Hey @darrenbarklie, thanks for submitting an issue!
I tried to reproduce using the following ways using both npm@6.14.9
and yarn@1.22.4
on node@14.15.3
and prismic-cli@3.8.6
(well, more or less the latest versions) without success using the following process:
$ npx create-next-app
$ prismic sm --setup
$ npm run dev # or yarn dev
Can you share your node version, npm version, prismic-cli version, and your package.json? A consistent way of reproducing would also help!
Thanks, looking forward to sorting that out 🙂
(cc @hypervillain, just in case you have an idea already)
Hey Lucie, I appreciate the fast response.
I'm running prismic-3.8.3-beta.0
, fetched with npm 7.4.3
on node v15.7.0
on Mac M1.
npx create-next-app prismic-test
prismic sm --setup --framework next
Blocking error:
✔ Downloading files from server
⠋ Installing dependencies
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR! peer react@">=16.0.0" from prismic-reactjs@1.3.3
npm ERR! node_modules/prismic-reactjs
npm ERR! prismic-reactjs@"*" from the root project
npm ERR! peer prismic-reactjs@"^1.3.1" from essential-slices@1.0.3
npm ERR! node_modules/essential-slices
npm ERR! essential-slices@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.13.1" from essential-slices@1.0.3
npm ERR! node_modules/essential-slices
npm ERR! essential-slices@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
...
ERROR ENOENT: no such file or directory, open 'pages/_app.js' 09:00:43
at Object.openSync (node:fs:490:3)
at Object.writeFileSync (node:fs:1542:35)
at Object.write (/usr/local/lib/node_modules/prismic-cli/bin/common/utils/files.js:26:20)
at /usr/local/lib/node_modules/prismic-cli/bin/commands/slicemachine/commands/setup.js:105:18
at Array.forEach (<anonymous>)
at createFiles (/usr/local/lib/node_modules/prismic-cli/bin/commands/slicemachine/commands/setup.js:100:9)
at _callee3$ (/usr/local/lib/node_modules/prismic-cli/bin/commands/slicemachine/commands/setup.js:283:13)
at tryCatch (/usr/local/lib/node_modules/prismic-cli/node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/prismic-cli/node_modules/regenerator-runtime/runtime.js:293:22)
at Generator.next (/usr/local/lib/node_modules/prismic-cli/node_modules/regenerator-runtime/runtime.js:118:21)
Hope this helps, but let me know if you require further @lihbr, @hypervillain.
Thanks for sharing that! When syncing to your version I was able to reproduce it.
Looks like npm 7 now considers peer dependencies as required, leading to dependencies not installing themselves at all when there's a mismatch.
I'll check this afternoon to extend the range of React peer dependency on next-slicezone
, in the meantime I can recommend you to stick with the latest LTS version of node (14.15.4) which comes with npm 6 if possible.
Thanks for the link. I wasn't aware of this change for NPM7, but now note the optional --legacy-peer-deps
flag. I'll also revisit this later and report back if I can find a fix for v7 before rolling back to v6.
Hi again @lihbr - I can confirm I'm up and running by reverting to node v14.15.4
. Appreciate the guidance.
Fixed 🙌 https://github.com/prismicio/slice-machine/commit/b131f90be582b6fc97f5c7b145b1a6afa156a41b
Thanks again @darrenbarklie
Following the documentation, but encountering the same error on multiple attempts.
Encounter this hang during installation:
Eventually passes, however attempting to run the project produces:
Manually installing with
npm install next-transpile-modules
doesn't resolve the issue.Appreciate any support in unblocking.