Install bower component (angular-qr-scanner) using Meteor - angularjs

I'm trying to install Angular QR Scanner in my Meteor app. It seems the only way to install it is using Bower, however bower support for Meteor seems to be deprecated now for 1.3. I tried installing using npm install however I receive an error that qrcode.decode is not a function, despite importing both files needed.
Is there another way to install bower components using Meteor?

Ended up just importing the plain javascript implementation with html5-qrcode rather than using an angular directive.

Related

Problems updating to React 15.4.0

I'm getting this error with in all my files:
Module not found: Error: Cannot resolve module 'react/lib/ReactMount' in...
I'm using the latest version of react: 15.4.0.
webpack: 1.12.11
Any help?
One quick solution to this will be use npm to install reactjs.
npm install --save react react-dom
Don't use standalone react bundle.
More solutions can be provided if you post your webpack config file.
The problems seems to be located in react-hot-loader library.
As mentioned #gaereon in my react gitub post, apps should not rely on internal APIs. So, react-hot-loader is using ReactMount.
I asked to fix it, for now I will return to latest version of React.
UPDATE
I had the 1x version. I switched to 3x beta version and works fine.

Using angular from both atmosphere and npm gives warning

Using Meteor 1.3.2.4 I do:
meteor create myapp
cd myapp
meteor npm install --save angular
meteor add angularjs:angular
and in main.js add as first line
import angular from 'angular';
This gives me
WARNING: Tried to load angular more than once.
in the browser console.
I guess this is because angular packages from both npm and atmosphere are added, but I do not know how to circumvent this if I need an atmosphere package that depends on angularjs:angular and also want to to use angular from npm (for example when using angular-meteor). More specifically I want to use the package angular-leaflet-directive in a meteor/angular app. Any suggestions ?
I asked the same question here.
The package author needs to follow those instructions here to make his package work on both Meteor 1.3 and Meteor 1.2 and earlier.
Maybe you could submit a pull request for him and until he will merge it, you could publish to Atmosphere under your own user.
Also, you could just bring angular-leaflet-directive from npm!

Using npm on Meteor 1.3 + angular1 (bump!)

Edit note:
I am changing this question as I progress. Will continue to update.
I've upgraded my angular-meteor project (Meteor 1.2.1 + jade + ES6 js) to 1.3. The update was successful and everything works as before. I'd like to start using npm to install angular plugins as in:
meteor npm i <package>
As a first step, I've installed angular and angular-meteor:
meteor npm i angular --save
meteor npm i angular-meteor --save
then added:
import angular from 'angular';
import 'angular-meteor';
I've got a few missing packages errors on the server side, and fixed those by adding them using npm i <package> --save
Now I'm bumping against:
Error: Can't find npm module 'ecmascript'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?
W20160410-21:27:53.530(3)? (STDERR) at Object.Npm.require (/Users/user/work/myproj/.meteor/local/build/programs/server/boot.js:195:17)
Ideas?
Update
I assumed that adding ecmascript would fix it, but the error happens when it's installed. To be clear, I wasn't sure if to meteor add ecmascript or to meteor npm i ecmascript so tried both, separately and together. Nether fixed the above error.
That being said, meteor add ecmascript actually got ES6 errors to stop, so I know it's there and active
2nd-Update (3 weeks later)
Waiting and retrying the update after a couple of weeks solved it: I've run Meteor update then run the server, which in turn errored a few times about missing npm packages but after [meteor] npm install of those, everything worked like a charm. Problem solved!
In previous version of Meteor Angular we removed ecmascript if you're migrating, add it back
meteor add ecmascript
Here are the steps that worked for me:
1. meteor update
2. review the packages that did not upgrade and upgraded them. Specifically the ones shown bellow:
The following top-level dependencies were not updated to the very latest version available:
* angular 1.3.7 (1.3.10 is available)
* angular-meteor-auth 0.2.2 (1.0.2_1 is available)
Newer versions of the following indirect dependencies are available:
* angular-meteor-data 0.3.0 (1.3.10 is available)
* angular-templates 1.0.1 (1.0.2 is available)
* pbastowski:angular-babel#1.3.4
meteor npm init (and fill all details)
npm install --save angular angular-meteor
added the following import on app.js (main app file): import angular from 'angular';
(I added also import angularMeteor from 'angular-meteor';, but it does not seem to be necessary).
I received one strict-di error which I fixed by adding 'ngInject'; to that function (RoutingHandler).
That made my project work as before (no new npm packages, no extra imports).

How to use existing libraries in reactjs/webpack like GSAP?

I want to use existing library like GSAP. I am using webpack, though I don't know what is the right way to do this. Should I be using bower to install my packages and injecting them into my index.html where there are the js and css injection points as if I had used grunt? Or should I be npm installing packages?
You have to use npm package installation and you have to use like
npm install --save GSAP
it will also update your package.json file.

Why would i install bower with NPM?

I'm failing to understand something,
I've started learning AngularJS, and there is a option to install it trough bower.
Then i went and read what is this bower thingy, and it said that this is a package manager.
But the installation of bower (in the tutorial at least) is trough NPM, which is node's package manager.
So... Why would a package manager that is installed with node will be used to install AngularJS? unless i want to use both of them - what's the point?
npm is much more well suited for server side javascript package management. Bower is written specifically to serve the brower's javascript package management needs. For example, npm allows for nested js and nested versions, bower makes the entire dependency tree into flat siblings. That said bower is powered by nodejs, so it makes sense that npm would be the method for getting access to bower. The idea is that you use both.

Resources