Skip to content

bug: Dependency error when starting a new project #30325

Closed
@betullam

Description

@betullam

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

When starting a new blank project with ionic start for the React framework, I get a dependency error:

$ ionic start

...

> npm i --save -E @capacitor/haptics @capacitor/app @capacitor/keyboard @capacitor/status-bar
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: @capacitor/[email protected]
npm error node_modules/@capacitor/core
npm error   @capacitor/core@"6.2.1" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @capacitor/core@">=7.0.0" from @capacitor/[email protected]
npm error node_modules/@capacitor/haptics
npm error   @capacitor/haptics@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/username/.npm/_logs/2025-04-01T05_53_45_459Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/username/.npm/_logs/2025-04-01T05_53_45_459Z-debug-0.log
[ERROR] An error occurred while running subprocess npm.
        
        npm i --save -E @capacitor/haptics @capacitor/app @capacitor/keyboard @capacitor... exited with exit code 1.
        
        Re-running this command with the --verbose flag may provide more information.

...

I think the problem is that capacitor/core is not yet available in Version 7.0.0. Anyway, a way to install the packages is using the --legacy-peer-deps option as suggested in the error message.

Expected Behavior

There should not be any dependency error.

Steps to Reproduce

  1. Install ionic as per the official docs
  2. Start a new project with ionic start
    • Don't use the "app creation wizard" (say "n")
    • Choose the "React" framework
    • Add a project name
    • Choose the "blank" starter template

Code Reproduction URL

not possible

Ionic Info

Ionic:

  • Ionic CLI : 7.2.1 (/home/username/.nvm/versions/node/v22.14.0/lib/node_modules/@ionic/cli)
  • Ionic Framework : @ionic/react 8.5.2

Utility:

  • cordova-res : not installed globally
  • native-run : 2.0.1

System:

  • NodeJS : v22.14.0 (/home/username/.nvm/versions/node/v22.14.0/bin/node)
  • npm : 11.2.0
  • OS : Linux 6.11

Additional Information

Some details about my system:

  • OS: Ubuntu 24.04.2
  • nvm version: 0.40.2
  • npm version: 11.2.0
  • node version: 22.14.0
  • ionic cli version: 7.2.1
  • ionic framework version: @ionic/react 8.5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: replythe issue needs a response from the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions