ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Are dependencies correct?

Open JoshMcCullough opened this issue 2 years ago • 2 comments

Two-part question:

  1. Looking at this commit, deps such as @ckeditor/ckeditor5-engine where moved from dependencies to devDependencies. It seems that these should be actual deps since they are not used as part of the build process. This is causing issues, because of ...
  2. ckeditor-react is using >= for the semver versioning of ckeditor-react. So when I install our custom CKE inline build into our consuming app, NPM tries to install @ckeditor/[email protected] even though we are not yet on v40. What seems to be happening is ckeditor-react essentially is asking for any version >=37, so NPM selects v40, not knowning that our custom build requires ^38.0.1 -- since it's in there as a devDependency (as it is in all of the CKE packages I checked).

Here's what the failed install looks like:

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: undefined@undefined npm ERR! Found: @ckeditor/[email protected] npm ERR! node_modules/@ckeditor/ckeditor5-engine npm ERR! peer @ckeditor/ckeditor5-engine@">=37.0.0" from @ckeditor/[email protected] npm ERR! node_modules/@ckeditor/ckeditor5-react npm ERR! @ckeditor/ckeditor5-react@"^6.1.0" from the root project npm ERR! peer @ckeditor/ckeditor5-react@"^6.1.0" from @my-org/[email protected] npm ERR! node_modules/@my-org/example-app-react npm ERR! @my-org/example-app-react@"1.0.5" from the root project npm ERR! @ckeditor/ckeditor5-engine@"40.0.0" from @ckeditor/[email protected] npm ERR! node_modules/@ckeditor/ckeditor5-core npm ERR! peer @ckeditor/ckeditor5-core@">=37.0.0" from @ckeditor/[email protected] npm ERR! node_modules/@ckeditor/ckeditor5-react npm ERR! @ckeditor/ckeditor5-react@"^6.1.0" from the root project npm ERR! 1 more (@my-org/example-app-react) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @ckeditor/ckeditor5-engine@"^38.0.1" from @my-org/[email protected] npm ERR! node_modules/@my-org/example-ckeditor-my-plugin npm ERR! peer @my-org/example-ckeditor-reference@"^1.0.0" from @my-org/[email protected] npm ERR! node_modules/@my-org/example-app-react npm ERR! @my-org/example-app-react@"1.0.5" 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.

Note that we cannot agree on which version of @ckeditor/ckeditor5-engine to install.

📃 Other details

  • Browser: N/A
  • OS: Manjaro Linux / N/A
  • CKEditor version: 38.0.1
  • Installed CKEditor plugins: N/A

If you'd like to see this improvement implemented, add a 👍 reaction to this post.

JoshMcCullough avatar Oct 11 '23 20:10 JoshMcCullough

Hi!

ckeditor-react essentially is asking for any version >=37

but this is a peerDependency which means it's not automatically installed in some cases:

npm versions 1, 2, and 7 will automatically install peerDependencies if they are not explicitly depended upon higher in the dependency tree.

I think --legacy-peer-deps is a workaround right now, and it should disable the installation of peer deps. We will take a look at this issue when discussing the future of predefined builds. cc @filipsobol

Witoso avatar Oct 20 '23 09:10 Witoso

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Oct 19 '24 23:10 CKEditorBot

We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

CKEditorBot avatar Nov 19 '24 23:11 CKEditorBot