What if I don't put "meteor" in front of "npm install ..."?


#1

I’m on 1.4 and haven’t been adding npm packages with “meteor npm install”. Does it matter?


#2

It doesn’t matter if the npm version you have installed locally is the same as the one bundled with meteor.

You can compare the two versions:
meteor npm -v and npm -v

Some versions of npm install modules with a different folder structure than others, so it might make a difference - especially if you use both.


#3

It will cause trouble if your local version of node is different to meteor’s and you have npm packages that build native extensions e.g. node-sass.

Personally, I’ve been using yarn instead of npm and just have to run meteor npm rebuild node-sass sometimes.


#4

So when starting a new project should I go with ‘npm install’ or ‘meteor npm install’? Why even bother with the meteor version of node if it’s older than npm?


#5

If a package has native extensions like node-sass or bcrypt, then for it to work with meteor you have to install it with the same version of node that meteor uses.

The easy way to do this is by running meteor npm install. There’s no good reason for you to not do this every time.


#6

The node version when you compile native extensions while installing has to exactly match the one you run. Meteor has a fixed version of node for each release so that the whole platform can be more stable, therefore you need to compile the native extensions for the version of Node used by Meteor.

In 1.4.2, you’ll be able to meteor yarn install things!


#7

Makes sense. Thanks guys!


#8

no way really? That’s awesome! Who doesn’t love yarn :clap:


#9

@sashko so with React, GraphQL and Yarn you have officially became the open source division of Facebook?:rofl:


#10

Facebook is building some great stuff which also aligns with our own philosophy - for example, yarn brings to npm a lot of the same stuff that the meteor package system has.


#11

Yeah I moved from Blaze to React recently and WOW. The clarity of thought I have about my apps now. It’s unreal. Keep going in the direction you guys are moving, it’s a good one!


#12

You should check out Vue.


#13

@aadams, where do you get all these animated GIF’s ? :slight_smile: Really cool and a nifty way to attract attention to your post (until every one else does that).


#15

Is your big-fin-gifs hiring? :slight_smile: