You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specify not only the major version of the dependencies listed in the package.json generated by create-next-app, but also includes the patch version
#67877
Specify all dependencies listed in package.json generated by create-next-app, including minor versions.
Non-Goals
No response
Background
Errors when installing a package with @types/react etc. as peerDependencies in a project generated by create-next-app.
# npm resolution error report
While resolving: @openameba/[email protected]
Found: @types/[email protected]
node_modules/@types/react
dev @types/react@"^18" from the root project
peerOptional @types/react@"^16.8.6 || ^17.0.0 || ^18.0.0" from @openameba/[email protected]
node_modules/@openameba/spindle-hooks
@openameba/spindle-hooks@"^1.2.0" from @openameba/[email protected]
node_modules/@openameba/spindle-ui
dev @openameba/spindle-ui@"^1.5.1" from the root project
@types/react@"*" from @types/[email protected]
node_modules/@types/react-dom
dev @types/react-dom@"^18" from the root project
Could not resolve dependency:
peerOptional @types/react@"^16.8.6 || ^17.0.0" from @openameba/[email protected]
node_modules/@openameba/spindle-ui
dev @openameba/spindle-ui@"^1.5.1" from the root project
Conflicting peer dependency: @types/[email protected]
node_modules/@types/react
peerOptional @types/react@"^16.8.6 || ^17.0.0" from @openameba/[email protected]
node_modules/@openameba/spindle-ui
dev @openameba/spindle-ui@"^1.5.1" from the root project
Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
It is more user-friendly to specify even minor versions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
Errors when installing a package with
@types/react
etc. as peerDependencies in a project generated by create-next-app.It is more user-friendly to specify even minor versions.
Proposal
Modify implementations in the shown below part.
next.js/packages/create-next-app/templates/index.ts
Lines 173 to 223 in a6215cc
Rewrite the part that specifies only the major version to include the minor version. I will create PR if necessary :)
Beta Was this translation helpful? Give feedback.
All reactions