Using npm packages


I understand that npm packages are supported.

I was trying to install via npm, so i did meteor npm install --save milligram. I then ran meteor npm install. meteor npm list lists the package, but I seem to be unable to use the css framework (nothing gets styled). Is there another step when using npm?

Usually with atmosphere and css frameworks I would just meteor add xxx and start using.


One more step - add the following import at the top of your template:

import 'milligram/dist/milligram.css';

See Importing styles in the Guide for more info.


@hwillson well I added the line you suggestion in my main js file, but the app crashes and the following gets outputted to the console:

I read through the links you suggested, made sure I had ecmascript installed as well, so not sure why this error is happening.


Can you post the contents of your .meteor/packages and .meteor/release files?


Sure, release- METEOR@


# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base             # Packages every Meteor app needs to have
mobile-experience       # Packages for a great mobile UX
mongo                   # The database Meteor supports right now
blaze-html-templates    # Compile .html files into Meteor Blaze views
session                 # Client-side reactive dictionary for your app
jquery                  # Helpful client-side library
tracker                 # Meteor's client-side reactive programming library

es5-shim                # ECMAScript 5 compatibility for older browsers.
ecmascript              # Enable ECMAScript2015+ syntax in app code

autopublish             # Publish all data to the clients (for prototyping)
insecure                # Allow all DB writes from clients (for prototyping)

Also, running meteor npm list shows milligram


Interesting - everything looks okay to me. Your Meteor version is a bit behind (latest recommended release is with coming any minute), so maybe try updating first. Milligram is working for me, but I’m using MacOS instead of Windows. You could always try removing your node_modules dir, running a meteor reset (usual caveat: will wipe your local Mongo DB), running meteor npm install, and trying your app again.