Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install Meteor Atmosphere packages locally so I can make modifications to it?

I am trying to get up and running with Meteor and seeing what it can offer, while I like it overall, it seems it's a very very rigid system.

I set up a small testing setup using Velocity, it opens a small overlay window on the side which has a class of "velocityOverlay". The overlay is really small and makes error stack traces wrap. All I wanted to do was to edit the css of the "velocityOverlay" and increase the width.

I somehow (after wasting time) managed to find that Meteor is actually putting all the packages in my user directory by default, once I found that, I found the needed css file...

velocity_html-reporter/.0.5.1.aykpxq++os+web.browser+web.cordova/web.browser/packages/velocity_html-reporter/lib/client-report.less.css

And I did a small edit to the width, next thing you know the meteor app crashes when trying to launch using the "meteor" command throwing a "Error: couldn't read entire resource" error. I can't even edit the bootstrap.css file I installed using "ian_bootstrap-3".

Further more, I can't find any way to install packages locally just for my particular project, what if I wanted to modify a package only for my particular project? this is very easy to do in vanilla Node.js, you simply don't use the "-g" when using "npm install".

To add to that, within my project root, there is another ".meteor/local/build/web.browser" folder with most of the global package files replicated again. When does Meteor use which? This is very confusing.

like image 385
Abdullah Khan Avatar asked Apr 11 '15 10:04

Abdullah Khan


1 Answers

You can run a package locally very easily.

Download it from Github (for example) and put it in the packages/ directory of your application like this /packages/package_name.

Then add it to your application with the same meteor add package_name command as usual.

Meteor will automatically look in the local folder before anywhere else and compile the package with the rest of your code. This allows you to do any modification you want on the package and test it locally before publishing it to the registry.

Also, folders located in .meteor/local/* are used for building purpose only and are generated automatically by Meteor. So it is not the best place to edit the files!

like image 80
Guillaume Avatar answered Sep 28 '22 19:09

Guillaume