Hi all ! Could someone suggest please … I am running ionic build android and see white screen and in the Chrome Dev Tools see Uncaught Error: Cannot find module “ionic-native” … All was fine before I am trying update my project to Ionic3.
try this command npm install @ionic-native/core --save
on your project dir
vnyksj, I am trying npm install @ionic-native/core --save on my project dir … then I see …
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.1: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”}
)
Then I am running ionic build android and see white screen and in the Chrome Dev Tools see Uncaught Error: Cannot find module “ionic-native”
Did you added the platform before building for Android?
vnyksj, of course !
vnyksj, understand…
You are likely using an old project or old sample code you found somewhere. There is no monolithic ‘ionic-native’ module any more. Read the docs for current usage syntax.
rapropos, good day ! Maybe it happens because I have such kind using ?
import {Device} from 'ionic-native';
Use: import {Device} from ‘@ionic-native/device’;
You have to import all your plugins from “@ionic-native/plugin_name”
lbrgeorge, Ок, understand.
I had this error when upgrading to 3.0. The change log helped: https://github.com/driftyco/ionic/blob/master/CHANGELOG.md#300-2017-04-05
The “Example Upgrade Commit” really helped as well, covered a few things not mentioned in the post: https://github.com/driftyco/ionic-conference-app/commit/62088