I'm receiving this error while executing ionic 2 :
Error
Runtime Error. Cannot find module “ionic-native”.
Stack
g#localhost:8100/build/polyfills.js:3:7138
localhost:8100/build/main.js:113219:16
webpack_require#localhost:8100/build/main.js:20:34
localhost:8100/build/main.js:87074:92
webpack_require#localhost:8100/build/main.js:20:34
localhost:8100/build/main.js:135215:89
webpack_require#localhost:8100/build/main.js:20:34
localhost:8100/build/main.js:66:37 global
code#localhost:8100/build/main.js:67:12
Install below
npm install ionic-native --save
Issue may be because of ionic package up-gradation. Delete node_modules folder.
The ionic packages are changed from ionic 2.x to 3.x. You need to do following changes.
Delete reference of ionic-native from package.json.
Install ionic 3.x native packages using following commands
npm install #ionic-native/core --save
npm install #ionic-native/splash-screen --save
npm install #ionic-native/#ionic-native/status-bar --save
3. Change references of ionic 2.x native package from app.module.ts.
import { SplashScreen } from '#ionic-native/splash-screen';
import {StatusBar } from '#ionic-native/status-bar';
Add StatusBar and SplashScreen in providers array of app.module.ts
Update imports of StatusBar and SplashScreen in app.component.ts ( Just like step no. 3)
Add following in constructor of app.component.ts
statusBar: StatusBar, splashScreen: SplashScreen
7. If you are using http service, import it in app.module.ts as below:
import { HttpModule } from '#angular/http';
Add HttpModule in imports array.
Note: You may need to do same thing for the other similar native packages.
Run the following command to install Ionic Native in your project:
npm install #ionic-native --save
I solved that error changing this:
import { NavController } from 'ionic-angular/umd'
to this:
import { NavController } from 'ionic-angular'
Related
I'm new to ember and I discover the command ember install pkg and I'm wondering why such package instead of using external package manager such as yarn or npm which are industry-wide/de-facto standard.
Question
Why should I use ember install over NPM or yarn?
ember install addon-name is a short hand for npm install --save-dev addon-name && ember g addon-name
The documentation provides the answer for this one (ctrl + f ember install):
Installs the given addon into your project and saves it to the
package.json file. If provided, the command will run the addon’s
default blueprint.
The release notes for version 0.1.5 provide a clue for this as well:
#2805 Added the install:addon command, which installs an addon with NPM and then runs the included generator of the same name if it
provides one.
So, ember install is just a replacement for npm in most cases but when a blueprint is provided it will run those as well.
In my ember application I have installed ember-browserify by running
npm install ember-browserify --save
I have then installed pit-scheduler by running
npm install pit-scheduler --save
and then I have restarted ember but when I go to the page I get this error
Uncaught Error: Could not find module npm:pit-scheduler imported from my-app/routes/schedule
Is it because I need to also npm install all of the dependency packages somehow?
in the actual package example these are packages which are being imported
<script src="js/jquery-2.2.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/moment-with-locales.min.js"></script>
<script src="js/bootstrap-datetimepicker.js"></script>
<script src="../dist/js/pitscheduler.min.js"></script>
I have already installed these packages by running npm install as well but still the same issue. Any idea why that is the case?
url to the packages
https://www.npmjs.com/package/pit-scheduler
https://www.npmjs.com/package/ember-browserify
I think that pit-schedular can't be included that way to Ember. Here's what you could do, clone pit-scheduler repository in vendor folder and then import it to ember-cli-build.js from there with:
app.import('vendor/pit-scheduler/dist/js/pitscheduler.min.js');
Taking Ember App for example. ember install ember-bootstrap-4 will add node package. But bower install tether --save will add bower package. Both are part of the app. But why one is in bower and one is in npm?
npm and bower are both packages manager in your Ember application but there are some differences in using them:
Bower is only used in front-end. It will download bower package into your Ember project (bower_component folder) and you still have to add it to your app's assets. For example, if you install moment package in bower, you have to add it to your app by going to ember-cli-build.js and add the following line app.import('bower_components/moment/moment.js'); (view more details in Ember Addons and Dependencies)
NPM is used for server packages. It will download packages into node_modules project. Every ember-cli addons is in npm and when you type ember install <addons-name>, ember will look up for ember addon, place your addon's info in package.json and download it in node_modules folder. Then, Ember will load it automatically for you.
bower install - is for including run time dependencies and you need to import it in ember-cli-build.js to use.
npm install - is for including development/build time dependencies.
I'm trying to use bootbox in my Ember app with ember-browserify. I have installed bootbox like a npm module and have added next to code:
import Bootbox from 'npm:bootbox';
Bu on compilation with ember-cli I got error:
The Broccoli Plugin: [object Object] failed with:
Error: Cannot find module 'jquery' from '/Users/Crabar/Documents/Programming/EmberDrinkIt/node_modules/bootbox'
Versions: Ember 2.2.0, EmberCLI 2.4.3
Have you tried to import the node module in the Brocfile.js?
app.import('node_modules/<path_to_module>.js');
from flask_mail import Mail,Message
from flask import Flask
I am trying to mail but import error is occurring
The are two packages by that name:
The project found on GitHub and in PyPI uses flask_mail as the package name; see their documentation and project source code.
Their layout indeed requires:
from flask_mail import Mail, Message
This is a fork of the other project, but is currently actively maintained.
There is a project on Bitbucket, and their Flask-Mail documentation and the project source code show that the correct import is:
from flaskext.mail import Mail, Message
This project appears to be outdated and has not seen an update for almost 3 years now. The Github project names the same original author, it appears to be an updated fork. I'd stick with the Github project.
If neither works, then there is no such module installed, not in the location that the Python version running your Flask server can find.
You have to install flask_mail in order to be able to import it.
if you are working with linux type this into your terminal and hit enter:
$ sudo pip install flask_mail
Here is a simple way to save time. Upgrade or update your pip before installing Flask-Mail. It worked on my Mac
pip install --user --upgrade pip
pip install Flask-Mail