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

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

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.

2 Likes

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.

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?

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.

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!

4 Likes

Makes sense. Thanks guys!

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

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

1 Like

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.

1 Like

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!

You should check out Vue.

@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).

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

1 Like