Using npm packages


#1

I understand that npm packages are supported.

I was trying to install https://milligram.github.io/ 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.


#2

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.


#3

@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: http://prntscr.com/bugx6y

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


#4

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


#5

Sure, release- METEOR@1.3.4.1

packages-

# 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)
standard-minifier-css
standard-minifier-js
kadira:flow-router
kadira:blaze-layout
accounts-ui
accounts-password
msavin:mongol
accounts-base
check

Also, running meteor npm list shows milligram
.


#6

Interesting - everything looks okay to me. Your Meteor version is a bit behind (latest recommended release is 1.3.4.4 with 1.3.5.1 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.