最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do I install Meteor Atmosphere packages locally so I can make modifications to it? - Stack Overflow

programmeradmin0浏览0评论

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" mand 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.

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" mand 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.

Share Improve this question edited Apr 12, 2015 at 2:35 Abdullah Khan asked Apr 11, 2015 at 10:11 Abdullah KhanAbdullah Khan 2,4253 gold badges23 silver badges34 bronze badges 4
  • 1 Did you check out these suggestions? stackoverflow./questions/18096390/… – Dabrorius Commented Apr 11, 2015 at 11:25
  • Seems to have some relevant information, better than being pletely lost. Thanks. – Abdullah Khan Commented Apr 11, 2015 at 12:09
  • 1 your title is too whiney sounding. Try to edit it to be your actual question, "how do I install package locally so I can make modifications to it?" which is actually simple as per the answer given. I understand, as most devs do, the frustration trying to get your head around new things, but on SO we try to keep the emotions out of the questions / answers. – Keith Nicholas Commented Apr 11, 2015 at 22:09
  • @KeithNicholas Haha, yeah, it's a new morning and I don't feel as horrible as I did when I wrote the question. – Abdullah Khan Commented Apr 12, 2015 at 2:37
Add a ment  | 

4 Answers 4

Reset to default 8

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 mand as usual.

Meteor will automatically look in the local folder before anywhere else and pile 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!

This worked for me https://atmospherejs./i/publishing. mrt link-package didn't work for me, might just be outdated code.

Steps:

  1. Download (or clone) package from GitHub to local dir
  2. Stop meteor if running

    2.1. Make sure you have a packages folder: mkdir packages

  3. Locally link your package:

    3.1 If you have mrt installed: Run mrt link-package /path/to/package in a project dir 3.2 If you don't have mrt: ln -s /path/to/package packages/package

  4. Then run meteor add developer:package-name, do not forget to change package name
  5. Run meteor in a project dir
  6. From now any changes in developer:package-name package folder will cause rebuilding of project app

Download the package and place it in new package directory in your project root. open the package.js inside the downloaded package and remove the author's name in the property "name:"

 e.g: - name:'dburles:google-maps' to name:'google-maps'

then run

meteor add google-maps

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论