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!
Related
So i created a react app using the create-react-app folder-name from cmd
So how do i add bootstrap and other libraries to launch on npm start i.e. when i launch the app. Do i install them with bower install or with npm install. I am so new to this i don't even get how are all the scdripts from the framework are launching with idnex.html. I know that the question is probably somewhat retarded, but idk how to even ask it correctly.
You can add any libraries you want utilizing npm and ES6 Import
Just Import anything you want in App.js.
Here is step by step guide on adding bootstrap to your project.
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.
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).
I'm just trying to run mean.js using grunt. Just did the installation steps in http://meanjs.org. But when loaded in localhost, console is showing error
Uncaught ReferenceError: angular is not defined
Can any one help how to resolve this problem?
It sounds like angular is not included on the page.
When the install process is over, npm will initiate a bower install command to install all the front-end modules needed (including angular) for the application
You can run bower manually using
bower install --config.interactive=false
make sure that angular appears in the public/lib folder and included on the page.
I'm just learning mean.js . Just did the installation steps in http://meanjs.org .
But when loaded in browser, console is showing error Uncaught ReferenceError: angular is not defined . do we need to include angularjs separately ?
Use this command
bower install --allow-root
No, you dont need to add angularjs one more time because angularjs is added as default in meanjs project.
You may try:
npm install
This command will install node packages and bower packages.
And then run project again:
npm start
Check running meanjs at http://localhost:3000
Hopefully you have a nice time with meanjs.