Cannot find module '@angular/core' when using cordova-plugin-file-opener2

I installed cordova-plugin-file-opener2 plugin using capacitor according to the instruction here and imported it with

import { FileOpener } from '@ionic-native/file-opener/ngx';

and no more code.
when I run it, it says:

Error: Cannot find module '@angular/core'
    at webpackMissingModule (:8100/static/js/7.chunk.js:1012)
    at Module../node_modules/@ionic-native/file-opener/ngx/index.js (:8100/static/js/7.chunk.js:1012)
    at __webpack_require__ (:8100/static/js/bundle.js:791)
    at fn (:8100/static/js/bundle.js:151)
    at Module../src/pages/calculate/calculate-component.jsx (:8100/static/js/main.chunk.js:3021)
    at __webpack_require__ (:8100/static/js/bundle.js:791)
    at fn (:8100/static/js/bundle.js:151)
    at Module../src/pages/Page.jsx (:8100/static/js/main.chunk.js:2840)
    at __webpack_require__ (:8100/static/js/bundle.js:791)
    at fn (:8100/static/js/bundle.js:151)
    at Module../src/App.jsx (:8100/static/js/main.chunk.js:648)
    at __webpack_require__ (:8100/static/js/bundle.js:791)
    at fn (:8100/static/js/bundle.js:151)
    at Module../src/index.jsx (:8100/static/js/main.chunk.js:2744)
    at __webpack_require__ (:8100/static/js/bundle.js:791)
    at fn (:8100/static/js/bundle.js:151)
    at Object.1 (:8100/static/js/main.chunk.js:3591)
    at __webpack_require__ (:8100/static/js/bundle.js:791)
    at checkDeferredModules (:8100/static/js/bundle.js:46)
    at Array.webpackJsonpCallback [as push] (:8100/static/js/bundle.js:33)
    at :8100/static/js/main.chunk.js:1

I’m using ionic 5 with react.
and actually it does not let me sync and it says:

Cannot find module: '@angular/core'. Make sure this package is installed.
You can install this package by running: npm install @angular/core.

should I install @angular/core ? why should I install angular when I don’t use it anymore?

I’ve never used React, but can’t help noticing that there is a “Using React? Click here” link in the documentation you linked to, and it does not have an /ngx at the end of its import.

1 Like

Oh! That is right! LOL . I should have imported it without /ngx at the end. Thank you