Ionic storage Error missing dependencies: #angular/core - ionic-framework

I followed this tutorial to install ionic camera in ionic project, but when I run ionic serve command I am getting this error:
[ng] ERROR in The target entry-point "#ionic/storage" has missing
dependencies: [ng] - #angular/core
and in browser on localhost:8100 I can see only "Cannot GET /" ERROR
How to fix this error so I can see my home page preview in browser

I had the same problem. Try exclude the folder (into your project) node_modules and then execute (into de same folder of the project) npm install. It's worked for me.

Related

The target entry-point "#ionic-native/media-capture" has missing dependencies: - #ionic-native/core

When I try to build my ionic mobile app on android I get the following error.
An error occurred during the build:
Error: The target entry-point "#ionic-native/media-capture" has missing dependencies:
- #ionic-native/core
at TargetedEntryPointFinder.findEntryPoints (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#angular/compiler-cli/ngcc/src/entry_point_finder/targeted_entry_point_finder.js:40:23)
at /Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#angular/compiler-cli/ngcc/src/execution/analyze_entry_points.js:28:41
at SingleProcessExecutorSync.SingleProcessorExecutorBase.doExecute (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#angular/compiler-cli/ngcc/src/execution/single_process_executor.js:28:29)
at /Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#angular/compiler-cli/ngcc/src/execution/single_process_executor.js:57:59
at SyncLocker.lock (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#angular/compiler-cli/ngcc/src/locking/sync_locker.js:34:24)
at SingleProcessExecutorSync.execute (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#angular/compiler-cli/ngcc/src/execution/single_process_executor.js:57:27)
at Object.mainNgcc (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#angular/compiler-cli/ngcc/src/main.js:74:25)
at Object.process (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#angular/compiler-cli/ngcc/index.js:29:23)
at NgccProcessor.processModule (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#ngtools/webpack/src/ngcc_processor.js:163:16)
at /Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#ngtools/webpack/src/ivy/host.js:55:18
at /Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#ngtools/webpack/src/ivy/host.js:47:24
at Array.map (<anonymous>)
at Object.host.resolveModuleNames (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/#ngtools/webpack/src/ivy/host.js:45:32)
at actualResolveModuleNamesWorker (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/typescript/lib/typescript.js:102904:133)
at resolveModuleNamesWorker (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/typescript/lib/typescript.js:103126:26)
at resolveModuleNamesReusingOldState (/Users/prabhashibuddhima/Documents/Personal/Projects/VRec/myVideo/node_modules/typescript/lib/typescript.js:103200:24)
An unhandled exception occurred: The target entry-point "#ionic-native/media-capture" has missing dependencies:
- #ionic-native/core
See "/private/var/folders/vp/8s5chkws6tx5v3wjyvr7n_qm0000gn/T/ng-HBL1kz/angular-errors.log" for further details.
I’m getting this error not only with the media-capture plugin. With Image-picker, file plugins also I’m getting the same error. I tried recreating the project, removing platforms and plugins and adding them again, npm install and all.
Please help me to solve this
It seems that you miss the #ionic-native/core dependency.
You need to run npm install --save #ionic-native/core to install it.
If the problem persists, try to delete the node_modules folder, and run npm install again.
the error means that you have installed #ionic-native/media-capture but it is lacking #ionic-native/core dependence which you need to install
by running this command:
npm i #ionic-native/core --save

Missing dependency: ionic-angular when trying to use ionic-stepper

I want to use ionic-stepper in my project.
I downloaded this package from https://www.npmjs.com/package/ionic-stepper. When I use it, I get the following error:
ERROR in The target entry-point "ionic-stepper" has missing dependencies:
[ng] - ionic-angular
What does this mean, and how can I fix it?
The error message is pretty clear. You're missing ionic-angular:
ERROR in The target entry-point "ionic-stepper" has missing dependencies:
[ng] - ionic-angular
ionic-angular is listed as a dependency, so you'll need to get a copy if you want to use ionic-stepper.
Here is the cause of your problem:
I downloaded this package...
Manually downloading files isn't the recommended way to install libraries from NPM.
Instead, use Yarn or the NPM CLI tool to install it. These tools will automatically identify and install dependent packages, like ionic-angular:
yarn add ionic-stepper

operation not permitted, unlink while adding cordova-plugin-firebase plugin in ionic

Installing "cordova-plugin-firebase" for android
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-firebase': Error: Uh oh!
EPERM: operation not permitted, unlink 'F:\ionic\PkjshopMerchant\platforms\android\app\src\main'
at Object.unlinkSync (fs.js:1129:3)
at mayCopyFile (F:\ionic\PkjshopMerchant\platforms\android\cordova\node_modules\fs-extra\lib\copy-sync\copy-sync.js:59:8)
As commented in this link : https://github.com/arnesson/cordova-plugin-firebase/issues/1154
there is a posible solution for it that is not downgrading to cordova#8.0.0
Studying the error message that occurs during the installation of the firebase plugin, we made a debug session and found that things were going wrong while the plugin was trying to copy google-services.json file from the plugin folder to the project folder.
The error message was:
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-firebase-lib': Error: Uh oh!
EPERM: operation not permitted, unlink '[My project folder]\apk\platforms\android\app\src\main'
It's something to the with file write permissions but we couldn't solve this by changing folder permissions and indexing.
From the stack trace, we saw that the copy operation was handled by the mayCopyFile function in the copy-sync.js javascript file that was located in the ..\apk\node_modules\fs-extra\lib\copy-sync folder.
Here's the function body:
function mayCopyFile (srcStat, src, dest, opts) {
if (opts.overwrite) {
fs.unlinkSync(dest)
return copyFile(srcStat, src, dest, opts)
} else if (opts.errorOnExist) {
throw new Error('${dest}' already exists)
}
}
fsunlinkSync and copyFile calls here crashes the installation. We couldn't proceed with the debug further, perhaps it would be better to proceed but we stopped here and found this solution:
Since these lines of code is trying to copy google-services.json file from the
..\apk\plugins\cordova-plugin-firebase\src\android
location to the
..\apk\platforms\android\app\src\main destination,
we decided to do this copy manually.
So here are the steps we followed:
Make sure you have a clean cordova project folder with no firebase plugin.
Have the android platform 9.0.0, if already not:
cordova platform rm android
cordova platform add android#9.0.0
Comment out the lines fsunlinkSync and copyFile in the mayCopyFile function in the ..\apk\node_modules\fs-extra\lib\copy-sync copy-sync.js file.
install firebase plugin:
cordova plugin add cordova-plugin-firebase-lib#3.0.0
(We've always been using this lib. Unfortunately cordova-plugin-firebase gives other build errors)
See that the plugin is installed and the platform is android 9.0.0
cordova plugin ls
cordova platform ls
Copy google-services.json file from
..\apk\plugins\cordova-plugin-firebase\src\android
location to the
..\apk\platforms\android\app\src\main destination,
manually.
Before the cordova build, uncomment the code lines you commented out in the 3rd step, because cordova build is going to copy lots of files from some source location to some destination location that isn't smart to copy manually.
Edit build.gradle file in the apk\platforms\android folder (change the gradle version appropriately):
classpath 'io.fabric.tools:gradle:1.28.0'
cordova build android
cordova run android
This worked. Of course, we added the cordova-device-plugin, edited the config.xml, added google-services.json to the project root folder etc as usual prerequisites, to make the plugin work.

IONIC 5 ionic serve produces Error: NGCC failed

I created a new ionic 5 project by using
ionic start myApp blank
When I run the project in browser using ionic serve it has given the following error
Error: NGCC failed
I figured out the problem my self
The problem was when I was installing the latest npm packages
it was installing the typescript: 4.0.2 and thats why the NGCC error
occured
run the following command and it will work,
npm i typescript#">=3.9.2 <4.0.0”
Or in future some one faces this error this is about the typescript version so just install the valid typescript and you will fix the ngcc error

Error: Cannot find module 'semver'

I was working on a simple Ionic App.
Steps taken:
updated ionic - OK
started new project - OK
created a couple of pages- OK
served the app - OK
but then I tried to add the android platform:
ionic platform add android
and got this error:
ERROR: Cannot find module 'semver'
at Function.Module._resolveFilename (module.js:336:15)
Caught exception:
undefined
Any idea on why I'm getting this error and how to fix it?
Thanks!
i faced same issue and i fix with below coment
sudo rm -rf node_modules/ package-lock.json
Looks like you're just missing a node module dependency. Try running npm install semver inside your project dir.