payloadcms / payload-3.0-demo

The official demo for Payload 3.0
https://next-payload-3-0-test.vercel.app
483 stars 162 forks source link

Getting dependency error while triying to install in existing "next": "14.2.3" project #184

Closed JoseAlbDR closed 5 months ago

JoseAlbDR commented 6 months ago

This is the error:

$ npx create-payload-app@beta

┌   create-payload-app 
│
◇   ────────────────────────────────────────────╮
│                                               │
│  Welcome to Payload. Let's create a project!  │
│                                               │
├───────────────────────────────────────────────╯
│
◇   ▲ Next.js  project detected!
│
◇  Install Payload in this project?
│  Yes
│
◇  Select a database
│  Postgres
│
◇  Enter PostgreSQL connection string
│  postgresql://postgres:password123@127.0.0.1:5432/next-payload-3
│
◑  Installing Payload and dependencies...│
■  Command failed with exit code 1: npm install --save payload@beta @payloadcms/next@beta @payloadcms/richtext-lexical@beta @payloadcms/db-postgres@beta
│  npm ERR! code ERESOLVE
│  npm ERR! ERESOLVE unable to resolve dependency tree
│  npm ERR! Could not resolve dependency:
│  npm ERR! peer next@"^14.3.0-canary.7" from @payloadcms/next@3.0.0-beta.24
│  npm ERR! node_modules/@payloadcms/next
│  npm ERR!   @payloadcms/next@"3.0.0-beta.24" 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.
│  npm ERR!
│  npm ERR!
│  npm ERR! For a full report see:
│  npm ERR! C:\Users\berti\AppData\Local\npm-cache\_logs\2024-05-04T23_04_12_230Z-eresolve-report.txt
│
│  npm ERR! A complete log of this run can be found in: C:\Users\berti\AppData\Local\npm-cache\_logs\2024-05-04T23_04_12_230Z-debug-0.log
◓  Installing Payload and dependencies...

Stuck in Installing Payload and dependencies...

Complete error log:

0 verbose cli C:\Program Files\nodejs\node.exe C:\Users\berti\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
1 info using npm@10.5.0
2 info using node@v20.10.0
3 timing npm:load:whichnode Completed in 3ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Users\berti\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\berti\OneDrive\Documentos\Programacion\FULL STACK\Next\02-my-dashboard\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\berti\.npmrc Completed in 0ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\berti\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 12ms
17 timing npm:load:configload Completed in 13ms
18 timing config:load:flatten Completed in 3ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm install payload@beta @payloadcms/next@beta @payloadcms/richtext-lexical@beta @payloadcms/db-postgres@beta
22 verbose argv "install" "--save" "payload@beta" "@payloadcms/next@beta" "@payloadcms/richtext-lexical@beta" "@payloadcms/db-postgres@beta"
23 timing npm:load:setTitle Completed in 0ms
24 timing npm:load:display Completed in 1ms
25 verbose logfile logs-max:10 dir:C:\Users\berti\AppData\Local\npm-cache\_logs\2024-05-04T23_04_12_230Z-
26 verbose logfile C:\Users\berti\AppData\Local\npm-cache\_logs\2024-05-04T23_04_12_230Z-debug-0.log
27 timing npm:load:logFile Completed in 11ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 61ms
31 timing arborist:ctor Completed in 0ms
32 silly logfile start cleaning logs, removing 2 files
33 silly logfile done cleaning log files
34 timing idealTree:init Completed in 139ms
35 timing arborist:ctor Completed in 0ms
36 http fetch GET 200 https://registry.npmjs.org/@payloadcms%2fnext 87ms (cache hit)
37 http fetch GET 200 https://registry.npmjs.org/@payloadcms%2fdb-postgres 90ms (cache hit)
38 http fetch GET 200 https://registry.npmjs.org/payload 96ms (cache hit)
39 http fetch GET 200 https://registry.npmjs.org/@payloadcms%2frichtext-lexical 116ms (cache hit)
40 timing idealTree:userRequests Completed in 122ms
41 silly idealTree buildDeps
42 silly fetch manifest @payloadcms/next@3.0.0-beta.24
43 silly fetch manifest graphql@^16.8.1
44 http fetch GET 200 https://registry.npmjs.org/graphql 15ms (cache hit)
45 silly fetch manifest next@14.2.3
46 http fetch GET 200 https://registry.npmjs.org/next 91ms (cache hit)
47 silly fetch manifest next@^14.3.0-canary.7
48 silly fetch manifest @opentelemetry/api@^1.1.0
49 http fetch GET 200 https://registry.npmjs.org/@opentelemetry%2fapi 7ms (cache hit)
50 silly fetch manifest @playwright/test@^1.41.2
51 http fetch GET 200 https://registry.npmjs.org/@playwright%2ftest 18ms (cache hit)
52 silly fetch manifest react@^18
53 http fetch GET 200 https://registry.npmjs.org/react 19ms (cache hit)
54 silly fetch manifest react-dom@^18
55 http fetch GET 200 https://registry.npmjs.org/react-dom 19ms (cache hit)
56 silly fetch manifest sass@^1.3.0
57 http fetch GET 200 https://registry.npmjs.org/sass 5ms (cache hit)
58 timing idealTree Completed in 1083ms
59 timing command:install Completed in 1090ms
60 verbose stack Error: unable to resolve dependency tree
60 verbose stack     at #failPeerConflict (C:\Users\berti\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1387:25)
60 verbose stack     at #loadPeerSet (C:\Users\berti\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1353:33)
60 verbose stack     at async #buildDepStep (C:\Users\berti\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:924:11)
60 verbose stack     at async Arborist.buildIdealTree (C:\Users\berti\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:203:7)
60 verbose stack     at async Promise.all (index 1)
60 verbose stack     at async Arborist.reify (C:\Users\berti\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:154:5)
60 verbose stack     at async Install.exec (C:\Users\berti\AppData\Roaming\npm\node_modules\npm\lib\commands\install.js:153:5)
60 verbose stack     at async module.exports (C:\Users\berti\AppData\Roaming\npm\node_modules\npm\lib\cli-entry.js:61:5)
61 verbose cwd C:\Users\berti\OneDrive\Documentos\Programacion\FULL STACK\Next\02-my-dashboard
62 verbose Windows_NT 10.0.19045
63 verbose node v20.10.0
64 verbose npm  v10.5.0
65 error code ERESOLVE
66 error ERESOLVE unable to resolve dependency tree
67 error
68 error While resolving: my-dashboard@0.1.0
68 error Found: next@14.2.3
68 error node_modules/next
68 error   next@"14.2.3" from the root project
68 error
68 error Could not resolve dependency:
68 error peer next@"^14.3.0-canary.7" from @payloadcms/next@3.0.0-beta.24
68 error node_modules/@payloadcms/next
68 error   @payloadcms/next@"3.0.0-beta.24" from the root project
68 error
68 error Fix the upstream dependency conflict, or retry
68 error this command with --force or --legacy-peer-deps
68 error to accept an incorrect (and potentially broken) dependency resolution.
69 error
69 error
69 error For a full report see:
69 error C:\Users\berti\AppData\Local\npm-cache\_logs\2024-05-04T23_04_12_230Z-eresolve-report.txt
70 verbose exit 1
71 timing npm Completed in 1465ms
72 verbose unfinished npm timer reify 1714863852603
73 verbose unfinished npm timer reify:loadTrees 1714863852608
74 verbose unfinished npm timer idealTree:buildDeps 1714863852870
75 verbose unfinished npm timer idealTree:#root 1714863852870
76 verbose code 1
77 error A complete log of this run can be found in: C:\Users\berti\AppData\Local\npm-cache\_logs\2024-05-04T23_04_12_230Z-debug-0.log
paulpopus commented 6 months ago

Hi @JoseAlbDR on the latest beta we require a 14.3 canary version of nextjs because it fixes a few critical issues for us

Do you still get this error if you upgrade your project to use next@^14.3.0-canary.7 or newer?

paulpopus commented 5 months ago

Closing this issue for now but let us know if the above suggestion doesn't work for you!

masonc-dev commented 3 months ago

I’m having this issue as well.